Skip to content

Yahoo Ads: Use bid.mtype and fix bid type on multi-format impressions - #4669

Open
MananRPatel wants to merge 5 commits into
prebid:masterfrom
MananRPatel:yahooAdsMtype
Open

MananRPatel wants to merge 5 commits into
prebid:masterfrom
MananRPatel:yahooAdsMtype

Conversation

@MananRPatel

@MananRPatel MananRPatel commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

🔧 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?

This PR does two things in the Yahoo Ads bidder. The same code serves the yssp, yahoossp and yahooAdvertising aliases.

Use bid.mtype: Yahoo Ads SSP is adding bid.mtype (OpenRTB 2.6) to its responses. The bidder now reads it to set each bid's media type.

Fix multi-format bids: today the bidder takes the type from the impression only and checks banner first. On an impression that offers both banner and video, every bid, including a VAST bid, is returned as banner. Reading the type from the bid fixes this.

🧠 Rationale behind the change

The bid type is now taken from the bid, in this order:

  1. mtype: 1 is banner, 2 is video. Other values are not supported by this bidder, so the bid is skipped with a badServerResponse error (Unsupported mtype <n> for bid '<id>') and the other bids are kept.
  2. No mtype (null or 0) on a banner+video impression: a <VAST element in adm means video, otherwise banner.
  3. No mtype on a single-format impression: the impression's format, as before.

Unchanged: bids on impressions with neither banner nor video are skipped, and an unknown impid still fails with Unknown ad unit code. Changed: on a single-format impression, an audio or native mtype now skips the bid.

🧪 Test plan

  • New makeBids cases in YahooAdsBidderTest cover each rule above: mtype taking precedence over the impression and over the markup, a zero mtype falling back to the markup, <VAST after an XML declaration and with attributes on the next line, the lowercase <vast>, <VASTAdTagURI> and <div>VAST</div> non-matches, a missing adm, and a banner-only impression with VAST markup staying banner.
  • One case sends mtype 3, 4 and 2 on the same impression: the first two are reported as badServerResponse errors with their error text, and the mtype 2 bid is still returned as video.
  • makeHttpRequests cases also cover existing request-side branches that had no test: a video-only impression, a banner with only w or only h, and regs.ext fields kept after the gpp promotion. mvn test and checkstyle pass.

🏎 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?

Companion change: prebid/prebid-server#5032 applies the same order to PBS-Go.


For contact: prebid-tech-team@yahooinc.com

Implemented with assistance from Claude Code.

On a banner+video impression the bidder labeled every bid as banner
because it only looked at the impression. Read bid.mtype first, fall
back to a VAST root tag check on adm when mtype is absent, and use the
impression only when it offers a single format.
MananRPatel added 3 commits October 18, 2026 18:02
A bid with an mtype other than banner or video is now skipped with a
badServerResponse error instead of being dropped silently; other bids
in the response are kept. Tests are consolidated with shared helpers.
The VAST check finds a VAST element anywhere in adm, not only at the
root, so drop "Root" from the test name.
@MananRPatel MananRPatel changed the title Yahoo Ads Adapter: resolve bid type from mtype before the impression Yahoo Ads: Resolve bid media type from mtype before the impression Oct 21, 2026
XML names are case-sensitive and the VAST root element is always VAST,
so drop the case-insensitive flag and the optional whitespace after "<".
Align the markup tests: VAST after an XML declaration and with
attributes on the next line is video; lowercase vast and a bare
VASTAdTagURI are banner.
@MananRPatel
MananRPatel marked this pull request as ready for review October 21, 2026 18:33
@MananRPatel MananRPatel changed the title Yahoo Ads: Resolve bid media type from mtype before the impression Yahoo Ads: Use bid.mtype and fix bid type on multi-format impressions Oct 21, 2026
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