Skip to content

Nativo adapter: Update bid type resolution - #5060

Open
shawnhe wants to merge 1 commit into
prebid:masterfrom
life360-oss:ADS-10178
Open

shawnhe wants to merge 1 commit into
prebid:masterfrom
life360-oss:ADS-10178

Conversation

@shawnhe

@shawnhe shawnhe commented Oct 28, 2026 •

Copy link
Copy Markdown

🔧 Type of changes

  • new bid adapter
  • bid adapter update
  • new feature
  • new analytics adapter
  • new module
  • module update
  • bugfix
  • documentation
  • configuration
  • dependency update
  • tech debt (test coverage, refactorings, etc.)

✨ What's the context?

What's the context for the changes?

🧠 Rationale behind the change

Why did you choose to make these changes? Were there any trade-offs you had to consider?

🔎 New Bid Adapter Checklist

  • verify email contact works
  • NO fully dynamic hostnames
  • geographic host parameters are NOT required
  • direct use of HTTP is prohibited - implement an existing Bidder interface that will do all the job
  • if the ORTB is just forwarded to the endpoint, use the generic adapter - define the new adapter as the alias of the generic adapter
  • cover an adapter configuration with an integration test

🧪 Test plan

How do you know the changes are safe to ship to production?

🏎 Quality check

  • Are your changes following our code style guidelines?
  • Are there any breaking changes in your code?
  • Does your test coverage exceed 90%?
  • Are there any erroneous console logs, debuggers or leftover code in your changes?

@shawnhe shawnhe changed the title ADS-10178: Label each bid with the format the Nativo exchange returne… Nativo: Label each bid with the format the Nativo exchange returne… Oct 28, 2026
@shawnhe shawnhe changed the title Nativo: Label each bid with the format the Nativo exchange returne… Nativo adapter: Update bid type resolution Oct 28, 2026
Comment thread adapters/nativo/nativo.go

// Get media type from the bid's mtype, which the Nativo exchange sets on every bid
func getMediaTypeForMType(mType openrtb2.MarkupType) (openrtb_ext.BidType, error) {
switch mType {

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. 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/nativo/nativo.go

// Get media type from the bid's mtype, which the Nativo exchange sets on every bid
func getMediaTypeForMType(mType openrtb2.MarkupType) (openrtb_ext.BidType, error) {
switch mType {

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. 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/nativo/nativo.go

// Get media type from the bid's mtype, which the Nativo exchange sets on every bid
func getMediaTypeForMType(mType openrtb2.MarkupType) (openrtb_ext.BidType, error) {
switch mType {

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. 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/nativo/nativo.go

// Get media type from the bid's mtype, which the Nativo exchange sets on every bid
func getMediaTypeForMType(mType openrtb2.MarkupType) (openrtb_ext.BidType, error) {
switch mType {

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

@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, f707e17

nativo

Refer here for heat map coverage report

github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:28:	MakeRequests		85.7%
github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:48:	MakeBids		100.0%
github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:103:	getRendererMeta		100.0%
github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:121:	getMediaTypeForMType	100.0%
github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:136:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v4/adapters/nativo/nativo.go:151:	getMediaTypeForImp	100.0%
total:									(statements)		98.5%

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.

1 participant