Skip to content

Commit

Permalink
appnnexus bid adapter - support for adomain (#9403)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored Jan 9, 2023
1 parent b739b29 commit dee8f35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,8 @@ 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: [] });
bid.meta = Object.assign({}, bid.meta, { advertiserDomains: [rtbBid.adomain] });
}

if (rtbBid.advertiser_id) {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ describe('AppNexusAdapter', function () {

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

let bidderRequest = {
bids: [{
Expand All @@ -1745,7 +1745,7 @@ describe('AppNexusAdapter', function () {
}
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([]);
expect(result[0].meta.advertiserDomains).to.deep.equal(['123']);
});
});

Expand Down

0 comments on commit dee8f35

Please sign in to comment.