Skip to content

Commit

Permalink
Ssp_geniee Bid Adapter : add support for GPID and pbadslot (#12806)
Browse files Browse the repository at this point in the history
* modify adUnit infomation

* fix imuid module

* feat(GenieeBidAdapter): Add support for GPID and pbadslot

- Add support for GPID (Global Placement ID) from ortb2Imp.ext.gpid
- Add fallback support for ortb2Imp.ext.data.pbadslot
- Include gpid parameter in request when GPID exists
- Add test cases to verify GPID, pbadslot, and priority behavior

---------

Co-authored-by: Murano Takamasa <[email protected]>
Co-authored-by: daikichiteranishi <[email protected]>
Co-authored-by: teranishi daikichi <[email protected]>
Co-authored-by: gn-daikichi <[email protected]>
Co-authored-by: takumi-furukawa <[email protected]>
  • Loading branch information
6 people authored Feb 27, 2025
1 parent e800318 commit 971e8f0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/ssp_genieeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ function hasParamsNotBlankString(params, key) {
* @see https://docs.prebid.org/dev-docs/bidder-adaptor.html#location-and-referrers
*/
function makeCommonRequestData(bid, geparameter, refererInfo) {
const gpid = utils.deepAccess(bid, 'ortb2Imp.ext.gpid') || utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot');

const data = {
zoneid: bid.params.zoneId,
cb: Math.floor(Math.random() * 99999999999),
Expand All @@ -145,6 +147,7 @@ function makeCommonRequestData(bid, geparameter, refererInfo) {
tpaf: 1,
cks: 1,
ib: 0,
...(gpid ? { gpid } : {}),
};

try {
Expand Down
53 changes: 53 additions & 0 deletions test/spec/modules/ssp_genieeBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,59 @@ describe('ssp_genieeBidAdapter', function () {
const request = spec.buildRequests([{...BANNER_BID, userId: {imuid}}]);
expect(request[0].data.extuid).to.deep.equal(`im:${imuid}`);
});

it('should include gpid when ortb2Imp.ext.gpid exists', function () {
const gpid = '/123/abc';
const bidWithGpid = {
...BANNER_BID,
ortb2Imp: {
ext: {
gpid: gpid
}
}
};
const request = spec.buildRequests([bidWithGpid]);
expect(String(request[0].data.gpid)).to.have.string(gpid);
});

it('should include gpid when ortb2Imp.ext.data.pbadslot exists', function () {
const pbadslot = '/123/abc';
const bidWithPbadslot = {
...BANNER_BID,
ortb2Imp: {
ext: {
data: {
pbadslot: pbadslot
}
}
}
};
const request = spec.buildRequests([bidWithPbadslot]);
expect(String(request[0].data.gpid)).to.have.string(pbadslot);
});

it('should prioritize ortb2Imp.ext.gpid over ortb2Imp.ext.data.pbadslot', function () {
const gpid = '/123/abc';
const pbadslot = '/456/def';
const bidWithBoth = {
...BANNER_BID,
ortb2Imp: {
ext: {
gpid: gpid,
data: {
pbadslot: pbadslot
}
}
}
};
const request = spec.buildRequests([bidWithBoth]);
expect(String(request[0].data.gpid)).to.have.string(gpid);
});

it('should not include gpid when neither ortb2Imp.ext.gpid nor ortb2Imp.ext.data.pbadslot exists', function () {
const request = spec.buildRequests([BANNER_BID]);
expect(request[0].data).to.not.have.property('gpid');
});
});
});

Expand Down

0 comments on commit 971e8f0

Please sign in to comment.