Skip to content

Commit

Permalink
look for gpid in the ortb2Imp.ext.gpid (prebid#11460)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonGoSonobi authored and f.caspar committed May 14, 2024
1 parent 9de3cd9 commit 179010a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/sonobiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function _validateFloor(bid) {
}

function _validateGPID(bid) {
const gpid = deepAccess(bid, 'ortb2Imp.ext.data.pbadslot') || deepAccess(getGptSlotInfoForAdUnitCode(bid.adUnitCode), 'gptSlot') || bid.params.ad_unit;
const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid') || deepAccess(bid, 'ortb2Imp.ext.data.pbadslot') || deepAccess(getGptSlotInfoForAdUnitCode(bid.adUnitCode), 'gptSlot') || bid.params.ad_unit;

if (gpid) {
return `gpid=${gpid},`
Expand Down
24 changes: 24 additions & 0 deletions test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,29 @@ describe('SonobiBidAdapter', function () {
}
}
},
{

'bidder': 'sonobi',
'params': {
'keywords': 'sports,news,some_other_keyword',
'placement_id': '1a2b3c4d5e6f1a2b3c4d',
'sizes': [[300, 250], [300, 600]],
'floor': '1.25',
},
'adUnitCode': 'adunit-code-42',
'sizes': [[300, 250], [300, 600]],
'bidId': '30b31c1838de1g',
ortb2Imp: {
ext: {
gpid: '/123123/gpt_publisher/adunit-code-42'
}
},
mediaTypes: {
banner: {
sizes: [[300, 250], [300, 600]]
}
}
},
{
'bidder': 'sonobi',
'params': {
Expand Down Expand Up @@ -343,6 +366,7 @@ describe('SonobiBidAdapter', function () {

let keyMakerData = {
'30b31c1838de1f': '1a2b3c4d5e6f1a2b3c4d|640x480|f=1.25,gpid=/123123/gpt_publisher/adunit-code-1,c=v,pm=1:2:3,p=2,pl=3,',
'30b31c1838de1g': '1a2b3c4d5e6f1a2b3c4d|300x250,300x600|f=1.25,gpid=/123123/gpt_publisher/adunit-code-42,c=d,',
'30b31c1838de1d': '1a2b3c4d5e6f1a2b3c4e|300x250,300x600|f=0.42,gpid=/123123/gpt_publisher/adunit-code-3,c=d,',
'/7780971/sparks_prebid_LB|30b31c1838de1e': '300x250,300x600|gpid=/7780971/sparks_prebid_LB,c=d,',
};
Expand Down

0 comments on commit 179010a

Please sign in to comment.