New Adapter: Viant - #4854
Conversation
|
|
||
| for _, imp := range imps { | ||
| if imp.ID == bid.ImpID { | ||
| if imp.Banner != nil { |
There was a problem hiding this comment.
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.BidTypeBanner, 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.
| if imp.Banner != nil { | ||
| return openrtb_ext.BidTypeBanner, nil | ||
| } | ||
| if imp.Video != nil { |
There was a problem hiding this comment.
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.
| if imp.Video != nil { | ||
| return openrtb_ext.BidTypeVideo, nil | ||
| } | ||
| if imp.Native != nil { |
There was a problem hiding this comment.
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.BidTypeNative, 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.
| if imp.Native != nil { | ||
| return openrtb_ext.BidTypeNative, nil | ||
| } | ||
| if imp.Audio != nil { |
There was a problem hiding this comment.
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.
|
We've updated the implementation to follow the recommended pattern. The adapter server now explicitly sets the MType field in the response, so the media type is determined from the MType field. |
Code coverage summaryNote:
viantRefer here for heat map coverage report |
| @@ -0,0 +1,25 @@ | |||
| endpoint: "https://bidders-us.adelphic.net/rtb/v25/viant-prebid-server/bidder" | |||
| endpoint: "https://bidders-us.adelphic.net/rtb/v25/viant-prebid-server/bidder" | ||
| endpointCompression: gzip | ||
| maintainer: | ||
| email: "dist-vps@viantinc.com" |
There was a problem hiding this comment.
waiting for respons
| endpointCompression: gzip | ||
| maintainer: | ||
| email: "dist-vps@viantinc.com" | ||
| gvlVendorID: 1542 |
|
|
||
| var extMap map[string]json.RawMessage | ||
| if err := jsonutil.Unmarshal(ext, &extMap); err != nil { | ||
| return nil |
There was a problem hiding this comment.
Consider returning the original ext on unmarshal failure instead:
if err := jsonutil.Unmarshal(ext, &extMap); err != nil {
return ext
}
Could you also add a supplemental fixture where imp.ext is not a JSON object, to document and test the current behavior?| // resolveRequestCurrency returns the first requested currency Viant supports so | ||
| // it can bid in it directly. If none of the requested currencies are supported | ||
| // (or none were requested), it returns defaultCurrency. | ||
| func resolveRequestCurrency(requestCurrencies []string) string { |
There was a problem hiding this comment.
This function reduces request.cur from a list to a single supported value. The behavior is non-obvious — OpenRTB allows multiple currencies, but here the request always goes out with exactly one. Please add a comment explaining why Viant requires a single currency in the outgoing request.
Also, when all currencies in request.cur are unsupported (e.g. ["JPY", "CNY"]), the function silently falls back to "USD". A supplemental fixture for this case would make the fallback behavior explicit and tested.
| dooh: | ||
| mediaTypes: | ||
| - banner | ||
| - video | ||
| - native | ||
| - audio |
There was a problem hiding this comment.
dooh is declared as a supported context — this is a valid PBS capability, but only two other adapters in the repo use it (optidigital, adtonos). Please confirm that Viant's server actually handles DOOH bid requests. If yes, please add at least one exemplary fixture (e.g. exemplary/dooh-banner.json) — without it there is no test coverage for this channel.



Submitting Viant's Prebid Server Side Adapter. Thank you.
Updated document PR: prebid/prebid.github.io#6660