Skip to content

Comments

bidResponseFilter: read mediaType from bid, not bid.meta#14415

Open
anastasiiapankivFS wants to merge 2 commits intoprebid:masterfrom
anastasiiapankivFS:fix-reading-media-type-from-bid
Open

bidResponseFilter: read mediaType from bid, not bid.meta#14415
anastasiiapankivFS wants to merge 2 commits intoprebid:masterfrom
anastasiiapankivFS:fix-reading-media-type-from-bid

Conversation

@anastasiiapankivFS
Copy link
Contributor

@anastasiiapankivFS anastasiiapankivFS commented Feb 5, 2026

Type of change

  • Bugfix

Description of change

bidResponseFilter reads mediaType from bid.meta, but mediaType is defined on bid level. As result valid bids are rejected when mediaType enforcement is enabled.

Note: Documentation suggest that it's possible to configure enforcement per mediaType with is not true.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 21707090861

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.231%

Totals Coverage Status
Change from base Build 21696531338: 0.0%
Covered Lines: 209722
Relevant Lines: 217936

💛 - Coveralls

@patmmccann patmmccann requested review from mkomorski and removed request for jefftmahoney February 6, 2026 12:25
@mkomorski
Copy link
Collaborator

docs fix addressed in prebid/prebid.github.io#6426

Copy link
Collaborator

@patmmccann patmmccann left a comment

Choose a reason for hiding this comment

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

I'm confused here, doesn't core just already filter on response mediatype matching the ad unit? I thought the goal was to allow pubs to filter IBV, which should have meta.mediaType as video and regular mediaType as banner

@patmmccann
Copy link
Collaborator

marking do not merge so we can discuss; i am not clear on the intention here

@anastasiiapankivFS
Copy link
Contributor Author

Hello @patmmccann

I am attempting to utilize bidResponseFilter module to address the following issue:

We currently receive approximately 0.05% of total daily bid responses with a mediaType of video for ad units configured as banner-only. If a bid with mediaType = video wins, it triggers an adRenderFailed event with the message Cannot render video ad without a renderer.

The objective is to filter out bid responses that contain media types not defined in the ad unit configuration.

During testing, we discovered that enabling media type filtering in bidResponseFilter results in valid banner bids being rejected. This occurs because the mediaType is being read from bid.meta, where it is returned as undefined. Please see screen recording for more details: https://drive.google.com/file/d/1V2YBdwlyJuuiG4JZQ3rr2EO1-cy8BkHI/view?usp=sharing

If this is not a use case this module is intended for, could you please advice what is the right place for such logic.

@antoine-ga
Copy link

The initial behavior was specifically designed to address the IBV scenario, where a banner request returns a video creative but the bid is still classified as mediaType: banner. The bidResponseFilter module compares bid.mediaType against bid.meta.mediaType, which in the case of an IBV bid would be video while bid.mediaType remains banner. Not all adapters support this, but appears to be a standard pattern looking at a few of them.

I might be wrong here, but from what I can see, core does validate whether a bid is well-formed but doesn't actually validate it against the ad unit's declared mediaTypes. Maybe that could be the right place to do such check.

@anastasiiapankivFS
Copy link
Contributor Author

anastasiiapankivFS commented Feb 11, 2026

Thanks for the clarification @antoine-ga. I will open a separate PR with mediaType enforcement incorporated in the core logic.

If we wanted to disable in-banner video ads as well using bidResponseFilter, how would we do that? We are currently facing a situation that valid banner bids that do not have bid.meta.mediaType are rejected (Please see screen recording mentioned above for more details). Could you please advice what needs to be changed in configuration to only reject in-banner video but keep valid banner bids?

@patmmccann
Copy link
Collaborator

patmmccann commented Feb 11, 2026

@anastasiiapankivFS we agree that the scenario you describe, " If a bid with mediaType = video wins, it triggers an adRenderFailed event with the message Cannot render video ad without a renderer." should be possible to filter out easily, but should actually be in core, as no one wants to let something win that prebid should easily be able to detect will fail in this way.

in addition we don't want to get rid of the ibv filtering capability based on the meta mediatype

@anastasiiapankivFS
Copy link
Contributor Author

@patmmccann @antoine-ga Would you be able to take a look #14468? Thanks

@antoine-ga
Copy link

@anastasiiapankivFS Sure, should we close this one now that we have the Core PR opened?

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.

8 participants