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

Prebid server adapter incompatible with sizeMappingV2? #8032

Closed
WalterT opened this issue Feb 9, 2022 · 4 comments · Fixed by #8084
Closed

Prebid server adapter incompatible with sizeMappingV2? #8032

WalterT opened this issue Feb 9, 2022 · 4 comments · Fixed by #8084
Assignees
Labels

Comments

@WalterT
Copy link

WalterT commented Feb 9, 2022

Type of issue

Bug

Description

The Prebid server adapter seems to be incompatible with the advanced size mapping module. Whenever ad units have a mediaTypes.banner.sizeConfig element rather than mediaTypes.banner.sizes, this error is raised when calling bids:

TypeError: Reduce of empty array with no initial value
at Array.reduce ()
at G.e.callBids (prebid-6.2.0.js:27)
at prebid-6.2.0.js:9
at Array.forEach ()
at Object.w.callBids (prebid-6.2.0.js:9)
at Object.run (prebid-6.2.0.js:9)
at d (prebid-6.2.0.js:9)
at Object.$ (prebid-6.2.0.js:9)
at Object. (prebid-6.2.0.js:9)
at Object.callBids (prebid-6.2.0.js:9)

referring to this function in the Prebid server adapter: https://github.com/prebid/Prebid.js/blob/master/modules/prebidServerBidAdapter/index.js#:~:text=out%20bid%20requests%20*/-,baseAdapter.callBids,-%3D%20function(s2sBidRequest%2C%20bidRequests

All validAdUnits seem to be filtered out because of that.

Am I analyzing this correctly?

Steps to reproduce

  • Build Prebid.js with prebidServerBidAdapter & sizeMappingV2 modules
  • Configure one ad unit as follows:
  var adUnits = [
    {
      code: 'test1',
      mediaTypes: {
        banner: {
          sizeConfig: [
          { minViewPort: [0, 0], sizes: [[300, 250], [300, 100]] },
          { minViewPort: [768, 0], sizes: [[728, 90], [300, 250]] }
        ]
        }
      },
      bids: [{
        bidder: 'appnexus',
        params: {
          placementId: 13144370
        }
      }]
    }
  ];
  • Add an s2s config:
    pbjs.setConfig({
    s2sConfig: [{
    accountId: '10',
    bidders: ['appnexus'],
    adapter: 'prebidServer',
    enabled: true,
    endpoint: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction',
    syncEndpoint: 'https://prebid.adnxs.com/pbs/v1/cookie_sync',
    timeout: 500
    }]
    })

Platform details

Prebid.js 6.2

@bretg
Copy link
Collaborator

bretg commented Feb 14, 2022

My view here is that Prebid.js core needs to pre-process AdUnits for the pbsBidAdapter. This covers responsive sizes (both global and advancedSizeMapping) as well as labels.

@dgirardi
Copy link
Collaborator

dgirardi commented Feb 14, 2022

@bretg the issue is that prebid core (or actually the sizeMapping module) pre-processes bid requests to have the correct sizes based on mapping configuration, but the PBS "adapter" does not look at bid requests, only the adUnit, so that it can compile all bidders into imp.ext.prebid

We can partially fix this so that the pre-processing is done on the adUnit (and the example in this particular issue would work), but sizeConfig (and labels) can also be specified at the bidder level. For that to work we need to either split different sizes into different ortb request (or maybe different imps - I am not too familiar with the protocol), or have PBS itself look for size information in imp.ext.prebid instead of imp.w and imp.h.

@bretg
Copy link
Collaborator

bretg commented Feb 14, 2022

Makes sense. I suppose if the long term goal is Prebid.less, then PBS will eventually need to understand these things. Very well, will add it to the list to define new extensions. It will be some time before they're supported though.

@bretg
Copy link
Collaborator

bretg commented Mar 15, 2022

This is the related PBS issue tracking the enhancement prebid/prebid-server#2168

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

Successfully merging a pull request may close this issue.

4 participants