Skip to content

Commit

Permalink
Support UID 2.0 pgamssp module (#10771)
Browse files Browse the repository at this point in the history
* new adapter PGAMSSP

* upd

* support UID 2.0

* del obj
  • Loading branch information
PGAMSSP authored Dec 7, 2023
1 parent 7f815d2 commit 32ff256
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/pgamsspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ function getPlacementReqData(bid) {
const placement = {
bidId,
schain,
bidfloor
bidfloor,
eids: []
};

if (bid.userId) {
getUserId(placement.eids, bid.userId.uid2 && bid.userId.uid2.id, 'uidapi.com');
}

if (placementId) {
placement.placementId = placementId;
placement.type = 'publisher';
Expand Down Expand Up @@ -91,6 +96,18 @@ function getBidFloor(bid) {
return 0;
}
}
function getUserId(eids, id, source, uidExt) {
if (id) {
var uid = { id };
if (uidExt) {
uid.ext = uidExt;
}
eids.push({
source,
uids: [ uid ]
});
}
}

export const spec = {
code: BIDDER_CODE,
Expand Down
1 change: 1 addition & 0 deletions test/spec/modules/pgamsspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ describe('PGAMBidAdapter', function () {
expect(placement.schain).to.be.an('object');
expect(placement.bidfloor).to.exist.and.to.equal(0);
expect(placement.type).to.exist.and.to.equal('publisher');
expect(placement.eids).to.exist.and.to.be.an('array');

if (placement.adFormat === BANNER) {
expect(placement.sizes).to.be.an('array');
Expand Down

0 comments on commit 32ff256

Please sign in to comment.