-
Notifications
You must be signed in to change notification settings - Fork 720
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 Adapter: AdTonos #3853
New Adapter: AdTonos #3853
Conversation
func getMediaTypeForImp(responseImpId string, requestImps []openrtb2.Imp) (openrtb_ext.BidType, error) { | ||
for _, requestImp := range requestImps { | ||
if requestImp.ID == responseImpId { | ||
if requestImp.Audio != 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.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeAudio, nil. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
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.
(Leaving this here because AdTonos is an audio ad exchange - we incidentally do audio-as-video for publishers which absolutely cannot play an audio ad due to technical constraints, but really we just want to return VASTs with sound only.)
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.
@rkaw92 what bot is suggesting is to use Mtype field in the response to decide returned mediaType for an impression instead of relying on impID. For example,
func getBidType(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
// determinate media type by bid response field mtype
switch bid.MType {
case openrtb2.MarkupBanner:
return openrtb_ext.BidTypeBanner, nil
case openrtb2.MarkupVideo:
return openrtb_ext.BidTypeVideo, nil
case openrtb2.MarkupAudio:
return openrtb_ext.BidTypeAudio, nil
case openrtb2.MarkupNative:
return openrtb_ext.BidTypeNative, nil
}
return "", &errortypes.BadInput{
Message: fmt.Sprintf("Could not define media type for impression: %s", bid.ImpID),
}
}
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.
Okay, makes sense. We don't have a way of always returning mtype currently, but I can add logic that will optionally use it when present, and fall back to the current heuristic if not. In the future, when mtype coverage increases, the code will have anticipated it.
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.
I've added handling for when mtype is explicitly indicated and left the guesstimation in place as a fallback, does that look better?
if requestImp.ID == responseImpId { | ||
if requestImp.Audio != nil { | ||
return openrtb_ext.BidTypeAudio, nil | ||
} else if requestImp.Video != 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.
Consider this as a suggestion. The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to openrtb_ext.BidTypeVideo, nil. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
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.
the media type defaults to openrtb_ext.BidTypeVideo, nil.
I think the review bot may be wrong here - we default to audio, not video.
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.
Code coverage summaryNote:
adtonosRefer here for heat map coverage report
|
@@ -0,0 +1,24 @@ | |||
endpoint: https://exchange.adtonos.com/bid/{{.PublisherID}} | |||
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 email for verification.
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.
Thank you, I believe a response has been sent back accordingly.
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.
email verified. thanks!
userSync: | ||
redirect: | ||
url: https://play.adtonos.com/redir?to={{.RedirectURL}} | ||
userMacro: '@UUID@' |
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.
user sync works.
Code coverage summaryNote:
adtonosRefer here for heat map coverage report
|
Sorry, must have had an old version of the page loaded. Thanks! |
Hi! Meet AdTonos, an audio ad exchange and Prebid member 👋
Docs: prebid/prebid.github.io#5543