Skip to content

Commit

Permalink
GPID is set first from GPID, then from pbadslot as a fallback. (prebi…
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGumGum authored and DecayConstant committed Jul 18, 2024
1 parent 809da26 commit 87f8ab4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ function buildRequests(validBidRequests, bidderRequest) {
} = bidRequest;
const { currency, floor } = _getFloor(mediaTypes, params.bidfloor, bidRequest);
const eids = getEids(userId);
const gpid = deepAccess(ortb2Imp, 'ext.data.pbadslot') || deepAccess(ortb2Imp, 'ext.data.adserver.adslot');
const gpid = deepAccess(ortb2Imp, 'ext.gpid') || deepAccess(ortb2Imp, 'ext.data.pbadslot');
let sizes = [1, 1];
let data = {};
data.displaymanager = 'Prebid.js - gumgum';
Expand Down
15 changes: 13 additions & 2 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,21 @@ describe('gumgumAdapter', 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 req = { ...bidRequests[0],
ortb2Imp: {
ext: {
gpid: '/17037559/jeusol/jeusol_D_1',
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);
expect(bidRequest.data.gpid).to.equal('/17037559/jeusol/jeusol_D_1');
});

it('should set the global placement id (gpid) if in pbadslot property', function () {
Expand Down

0 comments on commit 87f8ab4

Please sign in to comment.