Skip to content

Commit

Permalink
appnexus bid adapter - create stub for meta.advertiserDomains (#6753)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored and idettman committed May 21, 2021
1 parent 0296451 commit 549a3e7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,11 @@ function newBid(serverBid, rtbBid, bidderRequest) {
}
};

// WE DON'T FULLY SUPPORT THIS ATM - future spot for adomain code; creating a stub for 5.0 compliance
if (rtbBid.adomain) {
bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [] });
}

if (rtbBid.advertiser_id) {
bid.meta = Object.assign({}, bid.meta, { advertiserId: rtbBid.advertiser_id });
}
Expand Down
17 changes: 16 additions & 1 deletion test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,21 @@ describe('AppNexusAdapter', function () {
}
let result = spec.interpretResponse({ body: responseAdvertiserId }, {bidderRequest});
expect(Object.keys(result[0].meta)).to.include.members(['advertiserId']);
})
});

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

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

0 comments on commit 549a3e7

Please sign in to comment.