Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Schain as first party data may not work well with bidder-specific schains

Open dgirardi opened this issue 5 months ago • 2 comments

Since 10 we treat schain as first party data. Because bidder-specific FPD is merged together with global FPD, and because of how we merge arrays, setting both may not work as expected.

For example,

pbjs.setConfig({
  ortb2: {
    source: {
      schain: {
        ver: '1.0',
        complete: 1,
        nodes: [
          {asi: 'global'}
        ]
      }
    }
  }
});

pbjs.setBidderConfig({
  bidders: ['someBidder'],
  config: {
     ortb2: {
      source: {
        schain: {
          ver: '1.0',
          complete: 1,
          nodes: [
            {asi: 'someBidder'}
          ]
        }
      }
     }
  }
})

would result in someBidder receiving ortb2.source.ext.schain as

{
      ver: '1.0',
      complete: 1,
      nodes: [
        {asi: 'global'},
        {asi: 'someBidder'}
      ]
}

dgirardi avatar Jul 31 '25 16:07 dgirardi

@dgirardi to expand on the prebid 10 release notes and deprecated schain module doc

patmmccann avatar Aug 13 '25 16:08 patmmccann

Will there be any further improvements beyound simply mentioning the need to prevent the use of global and bidder-specific data in the spec?

I'm currently testing defining ortb2.source.ext.schain via setBidderConfig() and setting schain1 for special bidders and schain2 for the others. This seems to work fine for my cases.

But if there were a better way, I would be grateful.

Edit: I'm not using the schain module.

vlyby-nadja avatar Sep 08 '25 09:09 vlyby-nadja