Skip to content

Commit

Permalink
Add PBS ARs flag to adUnit (prebid#11347)
Browse files Browse the repository at this point in the history
  • Loading branch information
apukh-magnite authored and DecayConstant committed Jul 18, 2024
1 parent 7145faa commit 15f0e3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/magniteAnalyticsAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ magniteAdapter.track = ({ eventType, args }) => {
'source', () => bid.src === 's2s' ? 'server' : 'client',
'status', () => 'no-bid'
]);
// add a pbs flag if one of the bids has a server source
if (adUnit.bids[bid.bidId].source === 'server') adUnit.pbsRequest = 1;
// set acct site zone id on adunit
if ((!adUnit.siteId || !adUnit.zoneId) && rubiconAliases.indexOf(bid.bidder) !== -1) {
if (deepAccess(bid, 'params.accountId') == accountId) {
Expand Down
2 changes: 2 additions & 0 deletions test/spec/modules/magniteAnalyticsAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,8 @@ describe('magnite analytics adapter', function () {

// bid source should be 'server'
expectedMessage.auctions[0].adUnits[0].bids[0].source = 'server';
// if one of bids.source === server should add pbsRequest flag to adUnit
expectedMessage.auctions[0].adUnits[0].pbsRequest = 1;
expectedMessage.bidsWon[0].source = 'server';
expect(message).to.deep.equal(expectedMessage);
});
Expand Down

0 comments on commit 15f0e3c

Please sign in to comment.