Skip to content

Commit

Permalink
legacy appnexus bid adapter - add support for brandId (#7789)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored Dec 2, 2021
1 parent 7329dae commit e068bab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,10 @@ function newBid(serverBid, rtbBid, bidderRequest) {
bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
}

if (rtbBid.brand_id) {
bid.meta = Object.assign({}, bid.meta, { brandId: rtbBid.brand_id });
}

if (rtbBid.rtb.video) {
// shared video properties used for all 3 contexts
Object.assign(bid, {
Expand Down
14 changes: 14 additions & 0 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,20 @@ describe('AppNexusAdapter', function () {
expect(Object.keys(result[0].meta)).to.include.members(['advertiserId']);
});

it('should add brand id', function() {
let responseBrandId = deepClone(response);
responseBrandId.tags[0].ads[0].brand_id = 123;

let bidderRequest = {
bids: [{
bidId: '3db3773286ee59',
adUnitCode: 'code'
}]
}
let result = spec.interpretResponse({ body: responseBrandId }, {bidderRequest});
expect(Object.keys(result[0].meta)).to.include.members(['brandId']);
});

it('should add advertiserDomains', function() {
let responseAdvertiserId = deepClone(response);
responseAdvertiserId.tags[0].ads[0].adomain = ['123'];
Expand Down

0 comments on commit e068bab

Please sign in to comment.