Skip to content

Commit 665f356

Browse files
jsadwithjuliangan07njflynn
authored
Kargo Bid Adapter: Updates to GPID retrieval (prebid#10618)
* KargoBidAdapter: GPP Support * kargo adapter to forward schain object (#21) * wrap in if statement (#22) * KRKPD-572: Add spec for schain (#23) * wrap in if statement * update test for schain, file formatting * Adding site to Kargo adapter. * KRKPD-619 Updating Site object. * KRKPD-619 Adding null check for Site object. * Update modules/kargoBidAdapter.js Co-authored-by: Julian Gan <[email protected]> * Reducing the size of Site object. * remove white space that is causing linting error * Kargo Bid Adapter: Updates to gpid retrieval --------- Co-authored-by: Julian Gan <[email protected]> Co-authored-by: Neil Flynn <[email protected]>
1 parent 59cbc9c commit 665f356

File tree

2 files changed

+9
-31
lines changed

2 files changed

+9
-31
lines changed

modules/kargoBidAdapter.js

+2-25
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ function getImpression(bid) {
469469
imp.bidderWinCount = bid.bidderWinsCount;
470470
}
471471

472-
const gpid = getGPID(bid)
473-
if (gpid != null && gpid != '') {
472+
const gpid = deepAccess(bid, 'ortb2Imp.ext.gpid') || deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');
473+
if (gpid) {
474474
imp.fpd = {
475475
gpid: gpid
476476
}
@@ -493,29 +493,6 @@ function getImpression(bid) {
493493
return imp
494494
}
495495

496-
function getGPID(bid) {
497-
if (bid.ortb2Imp != null) {
498-
if (bid.ortb2Imp.gpid != null && bid.ortb2Imp.gpid != '') {
499-
return bid.ortb2Imp.gpid;
500-
}
501-
502-
if (bid.ortb2Imp.ext != null && bid.ortb2Imp.ext.data != null) {
503-
if (bid.ortb2Imp.ext.data.pbAdSlot != null && bid.ortb2Imp.ext.data.pbAdSlot != '') {
504-
return bid.ortb2Imp.ext.data.pbAdSlot;
505-
}
506-
507-
if (bid.ortb2Imp.ext.data.adServer != null && bid.ortb2Imp.ext.data.adServer.adSlot != null && bid.ortb2Imp.ext.data.adServer.adSlot != '') {
508-
return bid.ortb2Imp.ext.data.adServer.adSlot;
509-
}
510-
}
511-
}
512-
513-
if (bid.adUnitCode != null && bid.adUnitCode != '') {
514-
return bid.adUnitCode;
515-
}
516-
return '';
517-
}
518-
519496
export const spec = {
520497
gvlid: BIDDER.GVLID,
521498
code: BIDDER.CODE,

test/spec/modules/kargoBidAdapter_spec.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ describe('kargo adapter tests', function () {
155155
data: {
156156
adServer: {
157157
name: 'gam',
158-
adSlot: '/22558409563,18834096/dfy_mobile_adhesion'
158+
adslot: '/22558409563,18834096/dfy_mobile_adhesion'
159159
},
160-
pbAdSlot: '/22558409563,18834096/dfy_mobile_adhesion'
160+
pbadslot: '/22558409563,18834096/dfy_mobile_adhesion'
161161
},
162162
gpid: '/22558409563,18834096/dfy_mobile_adhesion'
163163
}
@@ -184,9 +184,9 @@ describe('kargo adapter tests', function () {
184184
data: {
185185
adServer: {
186186
name: 'gam',
187-
adSlot: '/22558409563,18834096/dfy_mobile_adhesion'
187+
adslot: '/22558409563,18834096/dfy_mobile_adhesion'
188188
},
189-
pbAdSlot: '/22558409563,18834096/dfy_mobile_adhesion'
189+
pbadslot: '/22558409563,18834096/dfy_mobile_adhesion'
190190
}
191191
}
192192
}
@@ -209,9 +209,10 @@ describe('kargo adapter tests', function () {
209209
data: {
210210
adServer: {
211211
name: 'gam',
212-
adSlot: '/22558409563,18834096/dfy_mobile_adhesion'
212+
adslot: '/22558409563,18834096/dfy_mobile_adhesion'
213213
}
214-
}
214+
},
215+
gpid: '/22558409563,18834096/dfy_mobile_adhesion'
215216
}
216217
}
217218
}

0 commit comments

Comments
 (0)