Skip to content

Commit d9a9e56

Browse files
authored
Missena Bid Adapter: forward GPID from ortb2Imp to ortb2.ext (#13373)
1 parent 79b8a59 commit d9a9e56

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

modules/missenaBidAdapter.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import {
22
buildUrl,
3+
deepAccess,
34
formatQS,
45
generateUUID,
56
getWinDimensions,
7+
isEmpty,
68
isFn,
9+
isStr,
710
logInfo,
811
safeJSONParse,
912
triggerPixel,
@@ -73,7 +76,15 @@ function toPayload(bidRequest, bidderRequest) {
7376
payload.screen = { height: getWinDimensions().screen.height, width: getWinDimensions().screen.width };
7477
payload.viewport = getViewportSize();
7578
payload.sizes = normalizeBannerSizes(bidRequest.mediaTypes.banner.sizes);
76-
payload.ortb2 = bidderRequest.ortb2;
79+
80+
const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');
81+
payload.ortb2 = {
82+
...(bidderRequest.ortb2 || {}),
83+
ext: {
84+
...(bidderRequest.ortb2?.ext || {}),
85+
...(isStr(gpid) && !isEmpty(gpid) ? { gpid } : {}),
86+
},
87+
};
7788

7889
return {
7990
method: 'POST',

test/spec/modules/missenaBidAdapter_spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const REFERRER2 = 'https://referer2';
1010
const COOKIE_DEPRECATION_LABEL = 'test';
1111
const CONSENT_STRING = 'AAAAAAAAA==';
1212
const API_KEY = 'PA-XXXXXX';
13+
const GPID = '/11223344/AdUnit#300x250';
1314

1415
describe('Missena Adapter', function () {
1516
$$PREBID_GLOBAL$$.bidderSettings = {
@@ -27,6 +28,9 @@ describe('Missena Adapter', function () {
2728
bidder: 'missena',
2829
bidId: bidId,
2930
mediaTypes: { banner: { sizes: [[1, 1]] } },
31+
ortb2Imp: {
32+
ext: { gpid: GPID },
33+
},
3034
ortb2: {
3135
device: {
3236
ext: { cdep: COOKIE_DEPRECATION_LABEL },
@@ -170,6 +174,11 @@ describe('Missena Adapter', function () {
170174
expect(payload.ortb2.user.ext.consent).to.equal(CONSENT_STRING);
171175
expect(payload.ortb2.regs.ext.gdpr).to.equal(1);
172176
});
177+
178+
it('should forward GPID from ortb2Imp into ortb2.ext', function () {
179+
expect(payload.ortb2.ext.gpid).to.equal(GPID);
180+
});
181+
173182
it('should send floor data', function () {
174183
expect(payload.floor).to.equal(3.5);
175184
expect(payload.floor_currency).to.equal('EUR');

0 commit comments

Comments
 (0)