From 29f59cde01f936477870a52687f30585fca38c26 Mon Sep 17 00:00:00 2001 From: Lisa Benmore Date: Mon, 27 Sep 2021 13:42:00 -0700 Subject: [PATCH] Gumgum: ADTS-156 Improve GPID support by checking for value in new location within request object --- modules/gumgumBidAdapter.js | 6 ++++-- test/spec/modules/gumgumBidAdapter_spec.js | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 7ac43d32d56..0580675eed8 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -298,8 +298,10 @@ function buildRequests(validBidRequests, bidderRequest) { // ADTS-134 Retrieve ID envelopes for (const eid in eids) data[eid] = eids[eid]; - // ADJS-1024 - if (utils.deepAccess(ortb2Imp, 'ext.data.adserver.name')) { + // ADJS-1024 & ADSS-1297 + if (utils.deepAccess(ortb2Imp, 'ext.data.pbadslot')) { + gpid = utils.deepAccess(ortb2Imp, 'ext.data.pbadslot') + } else if (utils.deepAccess(ortb2Imp, 'ext.data.adserver.name')) { gpid = ortb2Imp.ext.data.adserver.adslot } diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index e91308849ed..e11123729e0 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -229,13 +229,21 @@ describe('gumgumAdapter', function () { expect(bidRequest.data).to.not.have.property('irisid'); }); - it('should set the global placement id (gpid)', function () { + it('should set the global placement id (gpid) if in adserver property', function () { const req = { ...bidRequests[0], ortb2Imp: { ext: { data: { adserver: { name: 'test', adslot: 123456 } } } } } const bidRequest = spec.buildRequests([req])[0]; expect(bidRequest.data).to.have.property('gpid'); expect(bidRequest.data.gpid).to.equal(123456); }); + it('should set the global placement id (gpid) if in pbadslot property', function () { + const pbadslot = 'abc123' + const req = { ...bidRequests[0], ortb2Imp: { ext: { data: { pbadslot } } } } + const bidRequest = spec.buildRequests([req])[0]; + expect(bidRequest.data).to.have.property('gpid'); + expect(bidRequest.data.gpid).to.equal(pbadslot); + }); + it('should set the bid floor if getFloor module is not present but static bid floor is defined', function () { const req = { ...bidRequests[0], params: { bidfloor: 42 } } const bidRequest = spec.buildRequests([req])[0];