Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bid Requests Have Different Sizes Than Those Specified in Ad Units #12746

Closed
hi-ubaid opened this issue Feb 11, 2025 · 3 comments
Closed

Bid Requests Have Different Sizes Than Those Specified in Ad Units #12746

hi-ubaid opened this issue Feb 11, 2025 · 3 comments

Comments

@hi-ubaid
Copy link

hi-ubaid commented Feb 11, 2025

Description:
We are experiencing an issue where the bid responses from bidders contain sizes different from the ones explicitly defined in our ad units. This is causing discrepancies in our auction process.

The bid request sizes match the ones we define in mediaTypes.banner.sizes, as seen in the sample ad unit setup below. However, the actual bid responses often contain different sizes, which creates layout issues with our ad containers. This issue is more frequent when a new bid wins on the same ad unit where a previous bid had already won.

Key Details About Our Setup:
We ensure that mediaTypes.banner.sizes is explicitly set before calling pbjs.addAdUnits().
We are using Prebid.js with multiple bidders, but this behavior seems inconsistent across bidders.
The issue appears sporadically—some responses contain the expected sizes, while others do not.
Any guidance or debugging tips would be greatly appreciated.

@dgirardi
Copy link
Collaborator

If you are able to, I'd try to find either the bid request (from Prebid events) or the network request sent out to the exchange for an offending bid, to confirm whether they are getting the right size. Prebid does not enforce that the size in the response matches what was requested (see #9154).

How do you choose winners? Do you use setTargetingForGPTAsync? when you say

more frequent when a new bid wins on the same ad unit where a previous bid had already won

I suspect either an issue with the wrong bid being picked from the cache, or an issue with how you (re-)set up your ad units. Could you share the logic around ad unit setup & bidsBackHandler?

Other notes:

  • adUnit.mediaTypes.banner.sizes overrides adUnit.sizes, it's not necessary to provide both
  • size is not usually a bid parameter (adUnit.bids[].size), although I can't say categorically that no adapter expects it. Appnexus does not.

@dgirardi
Copy link
Collaborator

dgirardi commented Feb 11, 2025

I missed this on my first read

The bid request sizes match the ones we define in mediaTypes.banner.sizes, as seen in the sample ad unit setup below. However, the actual bid responses often contain different sizes

If that's the case there's not much that can be done about it except discarding the bids and raising the issue with your adtech partners. While waiting for #9154 you could do this by adjusting their cpm to 0, for example

pbjs.bidderSettings.standard.bidCpmAdjustment  = function(cpm, bidResponse, bidRequest)  {
    if (
       bidResponse.mediaType === 'banner' &&
       !bidRequest.mediaTypes.banner.sizes.find(([w, h]) => w === bidResponse.width && h === bidResponse.height)
    ) {
       return 0;
    } else {
       return cpm;
    }
}

@hi-ubaid
Copy link
Author

Sure @dgirardi thanks for the help, I'll definitely try this one out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants