Skip to content

Missena Bid Adapter: forward GPID from ortb2Imp to ortb2.ext #13373

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

Merged
merged 1 commit into from
Jun 16, 2025
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
13 changes: 12 additions & 1 deletion modules/missenaBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {
buildUrl,
deepAccess,
formatQS,
generateUUID,
getWinDimensions,
isEmpty,
isFn,
isStr,
logInfo,
safeJSONParse,
triggerPixel,
Expand Down Expand Up @@ -73,7 +76,15 @@ function toPayload(bidRequest, bidderRequest) {
payload.screen = { height: getWinDimensions().screen.height, width: getWinDimensions().screen.width };
payload.viewport = getViewportSize();
payload.sizes = normalizeBannerSizes(bidRequest.mediaTypes.banner.sizes);
payload.ortb2 = bidderRequest.ortb2;

const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');
payload.ortb2 = {
...(bidderRequest.ortb2 || {}),
ext: {
...(bidderRequest.ortb2?.ext || {}),
...(isStr(gpid) && !isEmpty(gpid) ? { gpid } : {}),
},
};

return {
method: 'POST',
Expand Down
13 changes: 11 additions & 2 deletions test/spec/modules/missenaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ const REFERRER2 = 'https://referer2';
const COOKIE_DEPRECATION_LABEL = 'test';
const CONSENT_STRING = 'AAAAAAAAA==';
const API_KEY = 'PA-XXXXXX';
const GPID = '/11223344/AdUnit#300x250';

describe('Missena Adapter', function () {
$$PREBID_GLOBAL$$.bidderSettings = {
missena: {
storageAllowed: true,
},
};
let sandbox = sinon.sandbox.create();
let sandbox = sinon.createSandbox();
sandbox.stub(config, 'getConfig').withArgs('coppa').returns(true);
sandbox.stub(autoplay, 'isAutoplayEnabled').returns(false);
const viewport = { width: getWinDimensions().innerWidth, height: getWinDimensions().innerHeight };
Expand All @@ -27,6 +28,9 @@ describe('Missena Adapter', function () {
bidder: 'missena',
bidId: bidId,
mediaTypes: { banner: { sizes: [[1, 1]] } },
ortb2Imp: {
ext: { gpid: GPID },
},
ortb2: {
device: {
ext: { cdep: COOKIE_DEPRECATION_LABEL },
Expand Down Expand Up @@ -80,7 +84,7 @@ describe('Missena Adapter', function () {
user: {
ext: { consent: CONSENT_STRING },
},
device: {
device: {
w: screen.width,
h: screen.height,
ext: { cdep: COOKIE_DEPRECATION_LABEL },
Expand Down Expand Up @@ -170,6 +174,11 @@ describe('Missena Adapter', function () {
expect(payload.ortb2.user.ext.consent).to.equal(CONSENT_STRING);
expect(payload.ortb2.regs.ext.gdpr).to.equal(1);
});

it('should forward GPID from ortb2Imp into ortb2.ext', function () {
expect(payload.ortb2.ext.gpid).to.equal(GPID);
});

it('should send floor data', function () {
expect(payload.floor).to.equal(3.5);
expect(payload.floor_currency).to.equal('EUR');
Expand Down