Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Pixfuture adapter #4117

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

pixfuture-media
Copy link

This Pixfuture Prebid Server Adapter enables seamless integration with Pixfuture's ad exchange, allowing publishers to leverage their demand through server-side header bidding. The adapter formats outgoing bid requests, processes incoming bid responses, and adheres to OpenRTB standards for efficient and privacy-compliant ad delivery.


// Builder builds a new instance of the Pixfuture adapter.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
bidder := &PixfutureAdapter{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can call this simply "adapter", the PixfutureAdapter identification is already supplied by the package name. As you have it, referencing your adapter from outside the package would be PixfutureAdapter.PixfutureAdapter which looks a little redundant. See example below:

  package foo

  type adapter struct {
    endpoint string
  }
  
  func  Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
    return &adapter{endpoint: "https://www.foo.com"}, nil
  }

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed!

var bidExt openrtb_ext.ExtBid
err := jsonutil.Unmarshal(bid.Ext, &bidExt)
if err == nil && bidExt.Prebid != nil {
return openrtb_ext.ParseBidType(string(bidExt.Prebid.Type))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 3f33089

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:49:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:64:	MakeBids		90.0%
total:									(statements)		91.4%

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 993f157

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:27:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:48:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:63:	MakeBids		90.0%
total:									(statements)		91.2%

@gargcreation1992 gargcreation1992 self-assigned this Dec 24, 2024
func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
if len(request.Imp) == 0 {
return nil, []error{&errortypes.BadInput{Message: "No impressions in the bid request"}}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not required here as this is being checked in the core codebase already. Here is the link -

if req.LenImp() < 1 {
return []error{errors.New("request.imp must contain at least one element.")}
}

return nil, []error{&errortypes.BadServerResponse{
Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info.", responseData.StatusCode),
}}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct but you could also use the common code as below -

if adapters.IsResponseStatusCodeNoContent(responseData) {
		return nil, nil
}

if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil {
		return nil, []error{err}
}

@@ -0,0 +1,16 @@
endpoint: "https://srv-adapter.pixfuture.com/pixservices"
maintainer:
email: "[email protected]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sent an email for verification. Please reply with "received".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants