Skip to content

Commit

Permalink
PubMatic supporting updated Criteo User Id module (#4431)
Browse files Browse the repository at this point in the history
* added support for pubcommon, digitrust, id5id

* added support for IdentityLink

* changed the source for id5

* added unit test cases

* changed source param for identityLink

* PubMatic supporting updated Criteo User Id module

* added a comment to re-start CI
  • Loading branch information
pm-harshad-mane authored and robertrmartinez committed Nov 11, 2019
1 parent 113a9fe commit 454cf34
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ function _handleEids(payload, validBidRequests) {
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.pubcid`), 'pubcommon', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.digitrustid.data.id`), 'digitru.st', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.id5id`), 'id5-sync.com', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.criteortus.${BIDDER_CODE}.userid`), 'criteortus', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.criteoId`), 'criteo.com', 1);// replacing criteoRtus
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.idl_env`), 'liveramp.com', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.lipb.lipbid`), 'liveintent.com', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.parrableid`), 'parrable.com', 1);
Expand Down
20 changes: 8 additions & 12 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1625,40 +1625,36 @@ describe('PubMatic adapter', function () {
});
});

describe('CriteoRTUS Id', function() {
describe('Criteo Id', function() {
it('send the criteo id if it is present', function() {
bidRequests[0].userId = {};
bidRequests[0].userId.criteortus = {pubmatic: {userid: 'criteo-rtus-user-id'}};
bidRequests[0].userId.criteoId = 'criteo-user-id';
let request = spec.buildRequests(bidRequests, {});
let data = JSON.parse(request.data);
expect(data.user.eids).to.deep.equal([{
'source': 'criteortus',
'source': 'criteo.com',
'uids': [{
'id': 'criteo-rtus-user-id',
'id': 'criteo-user-id',
'atype': 1
}]
}]);
});

it('do not pass if not string', function() {
bidRequests[0].userId = {};
bidRequests[0].userId.criteortus = {appnexus: {userid: 'criteo-rtus-user-id'}};
bidRequests[0].userId.criteoId = 1;
let request = spec.buildRequests(bidRequests, {});
let data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.criteortus = {pubmatic: {userid: 1}};
bidRequests[0].userId.criteoId = [];
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.criteortus = {pubmatic: {userid: []}};
bidRequests[0].userId.criteoId = null;
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.criteortus = {pubmatic: {userid: null}};
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.criteortus = {pubmatic: {userid: {}}};
bidRequests[0].userId.criteoId = {};
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
Expand Down

0 comments on commit 454cf34

Please sign in to comment.