Skip to content

Commit 1778504

Browse files
authored
appnexus Bid Adapter - add support for gptPreAuction (#6688)
1 parent 67d8722 commit 1778504

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

modules/appnexusBidAdapter.js

+5
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,11 @@ function bidToTag(bid) {
743743
tag.keywords = keywords;
744744
}
745745

746+
let gpid = utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
747+
if (gpid) {
748+
tag.gpid = gpid;
749+
}
750+
746751
if (bid.mediaType === NATIVE || utils.deepAccess(bid, `mediaTypes.${NATIVE}`)) {
747752
tag.ad_types.push(NATIVE);
748753
if (tag.sizes.length === 0) {

test/spec/modules/appnexusBidAdapter_spec.js

+11
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,17 @@ describe('AppNexusAdapter', function () {
629629
expect(payload.tags[0].use_pmt_rule).to.equal(true);
630630
});
631631

632+
it('should add gpid to the request', function () {
633+
let testGpid = '/12345/my-gpt-tag-0';
634+
let bidRequest = deepClone(bidRequests[0]);
635+
bidRequest.ortb2Imp = { ext: { data: { pbadslot: testGpid } } };
636+
637+
const request = spec.buildRequests([bidRequest]);
638+
const payload = JSON.parse(request.data);
639+
640+
expect(payload.tags[0].gpid).to.exist.and.equal(testGpid)
641+
});
642+
632643
it('should add gdpr consent information to the request', function () {
633644
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
634645
let bidderRequest = {

0 commit comments

Comments
 (0)