-
Notifications
You must be signed in to change notification settings - Fork 750
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
base: master
Are you sure you want to change the base?
New Pixfuture adapter #4117
Conversation
adapters/pixfuture/pixfuture.go
Outdated
|
||
// 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{ |
There was a problem hiding this comment.
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
}
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
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"}} | ||
} |
There was a problem hiding this comment.
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 -
prebid-server/endpoints/openrtb2/auction.go
Lines 770 to 772 in 32fdbc4
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), | ||
}} | ||
} |
There was a problem hiding this comment.
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]" |
There was a problem hiding this comment.
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".
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.