Skip to content

Commit

Permalink
set iab categories on bid response
Browse files Browse the repository at this point in the history
  • Loading branch information
braizhas committed Dec 16, 2024
1 parent 3fc9267 commit fc290df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion modules/adfBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ export const spec = {
meta: {
mediaType,
advertiserDomains: bidResponse.adomain,
dsa
dsa,
primaryCatId: bidResponse.cat?.[0],
secondaryCatIds: bidResponse.cat?.slice(1)
}
};

Expand Down
5 changes: 4 additions & 1 deletion test/spec/modules/adfBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,8 @@ describe('Adf adapter', function () {
}],
adrender: 1
}
}
},
cat: [ 'IAB1', 'IAB2' ]
}
]
}],
Expand Down Expand Up @@ -1117,6 +1118,8 @@ describe('Adf adapter', function () {
assert.deepEqual(bids[0].currency, serverResponse.body.cur);
assert.deepEqual(bids[0].mediaType, 'native');
assert.deepEqual(bids[0].meta.mediaType, 'native');
assert.deepEqual(bids[0].meta.primaryCatId, 'IAB1');
assert.deepEqual(bids[0].meta.secondaryCatIds, [ 'IAB2' ]);
assert.deepEqual(bids[0].meta.advertiserDomains, [ 'demo.com' ]);
assert.deepEqual(bids[0].meta.dsa, {
behalf: 'some-behalf',
Expand Down

0 comments on commit fc290df

Please sign in to comment.