Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonobi Bid Adapter : look for gpid in the ortb2Imp.ext.gpid #11460

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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