Skip to content

Commit

Permalink
appnexus Bid Adapter - add support for gptPreAuction (#6688)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored and idettman committed May 21, 2021
1 parent 07e5437 commit 4c0b20f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,11 @@ function bidToTag(bid) {
tag.keywords = keywords;
}

let gpid = utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
if (gpid) {
tag.gpid = gpid;
}

if (bid.mediaType === NATIVE || utils.deepAccess(bid, `mediaTypes.${NATIVE}`)) {
tag.ad_types.push(NATIVE);
if (tag.sizes.length === 0) {
Expand Down
11 changes: 11 additions & 0 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,17 @@ describe('AppNexusAdapter', function () {
expect(payload.tags[0].use_pmt_rule).to.equal(true);
});

it('should add gpid to the request', function () {
let testGpid = '/12345/my-gpt-tag-0';
let bidRequest = deepClone(bidRequests[0]);
bidRequest.ortb2Imp = { ext: { data: { pbadslot: testGpid } } };

const request = spec.buildRequests([bidRequest]);
const payload = JSON.parse(request.data);

expect(payload.tags[0].gpid).to.exist.and.equal(testGpid)
});

it('should add gdpr consent information to the request', function () {
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
let bidderRequest = {
Expand Down

0 comments on commit 4c0b20f

Please sign in to comment.