Skip to content
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

PubMatic to support LiveIntent User Id sub-module #4306

Merged
merged 13 commits into from
Oct 15, 2019
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
1 change: 1 addition & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ function _handleEids(payload, validBidRequests) {
_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.idl_env`), 'liveramp.com', 1);
_addExternalUserId(eids, utils.deepAccess(bidRequest, `userId.lipb.lipbid`), 'liveintent.com', 1);
}
if (eids.length > 0) {
payload.user.eids = eids;
Expand Down
38 changes: 37 additions & 1 deletion test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,43 @@ describe('PubMatic adapter', function () {
expect(data.user.eids).to.equal(undefined);
});
});
})

describe('LiveIntent Id', function() {
it('send the LiveIntent id if it is present', function() {
bidRequests[0].userId = {};
bidRequests[0].userId.lipb = { lipbid: 'live-intent-user-id' };
let request = spec.buildRequests(bidRequests, {});
let data = JSON.parse(request.data);
expect(data.user.eids).to.deep.equal([{
'source': 'liveintent.com',
'uids': [{
'id': 'live-intent-user-id',
'atype': 1
}]
}]);
});

it('do not pass if not string', function() {
bidRequests[0].userId = {};
bidRequests[0].userId.lipb = { lipbid: 1 };
let request = spec.buildRequests(bidRequests, {});
let data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.lipb.lipbid = [];
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.lipb.lipbid = null;
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
bidRequests[0].userId.lipb.lipbid = {};
request = spec.buildRequests(bidRequests, {});
data = JSON.parse(request.data);
expect(data.user.eids).to.equal(undefined);
});
});
});

it('Request params check for video ad', function () {
let request = spec.buildRequests(videoBidRequests);
Expand Down