Skip to content

New Adapter: Viant - #4854

Open
KEPlockr wants to merge 2 commits into
prebid:masterfrom
loc-kr:VIANT-S2S-ADAPTER
Open

New Adapter: Viant#4854
KEPlockr wants to merge 2 commits into
prebid:masterfrom
loc-kr:VIANT-S2S-ADAPTER

Conversation

@KEPlockr

@KEPlockr KEPlockr commented Jul 10, 2026

Copy link
Copy Markdown

Submitting Viant's Prebid Server Side Adapter. Thank you.

Updated document PR: prebid/prebid.github.io#6660

Comment thread adapters/viant/viant.go Outdated

for _, imp := range imps {
if imp.ID == bid.ImpID {
if imp.Banner != nil {

Copy link
Copy Markdown

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.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.

Comment thread adapters/viant/viant.go Outdated
if imp.Banner != nil {
return openrtb_ext.BidTypeBanner, nil
}
if imp.Video != nil {

Copy link
Copy Markdown

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.

Comment thread adapters/viant/viant.go Outdated
if imp.Video != nil {
return openrtb_ext.BidTypeVideo, nil
}
if imp.Native != nil {

Copy link
Copy Markdown

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.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.

Comment thread adapters/viant/viant.go Outdated
if imp.Native != nil {
return openrtb_ext.BidTypeNative, nil
}
if imp.Audio != nil {

Copy link
Copy Markdown

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.

@KEPlockr

Copy link
Copy Markdown
Author

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.

@github-actions

Copy link
Copy Markdown

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, e21e63a

viant

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/viant/viant.go:40:	Builder			100.0%
github.com/prebid/prebid-server/v4/adapters/viant/viant.go:47:	MakeRequests		92.1%
github.com/prebid/prebid-server/v4/adapters/viant/viant.go:137:	resolveRequestCurrency	100.0%
github.com/prebid/prebid-server/v4/adapters/viant/viant.go:148:	stripBidderExt		76.9%
github.com/prebid/prebid-server/v4/adapters/viant/viant.go:172:	MakeBids		100.0%
github.com/prebid/prebid-server/v4/adapters/viant/viant.go:236:	getMediaTypeForBid	100.0%
total:								(statements)		93.3%

@@ -0,0 +1,25 @@
endpoint: "https://bidders-us.adelphic.net/rtb/v25/viant-prebid-server/bidder"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

works:

Image

endpoint: "https://bidders-us.adelphic.net/rtb/v25/viant-prebid-server/bidder"
endpointCompression: gzip
maintainer:
email: "dist-vps@viantinc.com"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

waiting for respons

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

verified:

Image

endpointCompression: gzip
maintainer:
email: "dist-vps@viantinc.com"
gvlVendorID: 1542

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

verified:

Image

Comment thread adapters/viant/viant.go

var extMap map[string]json.RawMessage
if err := jsonutil.Unmarshal(ext, &extMap); err != nil {
return nil

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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?

Comment thread adapters/viant/viant.go
// 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 {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment on lines +20 to +25
dooh:
mediaTypes:
- banner
- video
- native
- audio

@przemkaczmarek przemkaczmarek Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

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