Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appnexus bid adapter: create stub for meta.advertiserDomains #6753

Merged
merged 1 commit into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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([]);
});
});
});