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

PulsePoint Bid Adapter: Support for first party eid data #8215

Merged
merged 48 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2fba6a2
ET-1691: Pulsepoint Analytics adapter for Prebid. (#1)
anand-venkatraman Oct 14, 2016
ca17acb
Merge remote-tracking branch 'upstream/master'
anand-venkatraman Oct 25, 2016
5da43c3
Adding bidRequest to bidFactory.createBid method as per https://githu…
anand-venkatraman Oct 25, 2016
cf41114
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Nov 8, 2016
62756a9
ET-1765: Adding support for additional params in PulsePoint adapter (#2)
anand-venkatraman Nov 9, 2016
f8fabb7
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Dec 8, 2016
b9af15c
ET-1850: Fixing https://github.com/prebid/Prebid.js/issues/866
anand-venkatraman Dec 8, 2016
6523c25
Merge pull request #3 from pulsepointinc/ET-1850
anand-venkatraman Dec 8, 2016
b5eeb7f
Minor fix
anand-venkatraman Dec 8, 2016
0f33ef5
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Mar 1, 2017
b5dbd34
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Jun 27, 2017
d6fcd11
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Jul 17, 2017
fce16ad
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Aug 15, 2017
9833867
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Sep 22, 2017
70924c5
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Oct 12, 2017
41f4aca
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Nov 13, 2017
aae98a7
Adding mandatory parameters to Bid
anand-venkatraman Nov 13, 2017
6d546ed
Merge from upstream
anand-venkatraman Nov 27, 2017
a04a18f
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Mar 7, 2018
467e9e3
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Apr 20, 2018
af1b3db
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Apr 30, 2018
a438b67
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman May 4, 2018
e2fa8c3
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman May 21, 2018
6db9eb4
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman May 22, 2018
92a6034
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman May 29, 2018
2195429
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Jan 21, 2019
c0e32d5
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman May 18, 2019
832976a
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman May 30, 2019
b780838
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Jun 19, 2019
07ccd3d
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Jul 10, 2019
8b5815f
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Jul 15, 2019
3d0dcc2
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Oct 1, 2019
4f24443
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Oct 30, 2019
cf94b55
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Oct 31, 2019
ac055d1
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Nov 7, 2019
66a991b
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Dec 9, 2019
4436d00
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Jan 23, 2020
7d3b19d
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Mar 13, 2020
692c23e
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Oct 13, 2020
5066f39
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Nov 17, 2020
e59be71
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Jan 20, 2021
4fa3fad
Merge branch 'master' of github.com:prebid/Prebid.js
anand-venkatraman Mar 4, 2021
df46692
Merge branch 'prebid:master' into master
anand-venkatraman May 27, 2021
079b395
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Sep 3, 2021
04f456a
Merge branch 'master' of https://github.com/prebid/Prebid.js
anand-venkatraman Mar 24, 2022
bbcdc42
PulsePoint: Support for first party ids
anand-venkatraman Mar 24, 2022
fb93423
changing to getConfig
anand-venkatraman Mar 24, 2022
6593a94
Refactor to use pubProvidedId
anand-venkatraman Mar 25, 2022
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
53 changes: 3 additions & 50 deletions modules/pulsepointBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,61 +419,14 @@ function user(bidRequest, bidderRequest) {
}
}
if (bidRequest) {
if (bidRequest.userId) {
ext.eids = [];
addExternalUserId(ext.eids, bidRequest.userId.pubcid, 'pubcid.org');
addExternalUserId(ext.eids, bidRequest.userId.britepoolid, 'britepool.com');
addExternalUserId(ext.eids, bidRequest.userId.criteoId, 'criteo.com');
addExternalUserId(ext.eids, bidRequest.userId.idl_env, 'liveramp.com');
addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.id5id.uid'), 'id5-sync.com', deepAccess(bidRequest, 'userId.id5id.ext'));
addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.parrableId.eid'), 'parrable.com');
addExternalUserId(ext.eids, bidRequest.userId.fabrickId, 'neustar.biz');
addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.haloId.haloId'), 'audigent.com');
addExternalUserId(ext.eids, bidRequest.userId.merkleId, 'merkleinc.com');
addExternalUserId(ext.eids, bidRequest.userId.lotamePanoramaId, 'crwdcntrl.net');
addExternalUserId(ext.eids, bidRequest.userId.connectid, 'verizonmedia.com');
addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.uid2.id'), 'uidapi.com');
// liveintent
if (bidRequest.userId.lipb && bidRequest.userId.lipb.lipbid) {
addExternalUserId(ext.eids, bidRequest.userId.lipb.lipbid, 'liveintent.com');
}
// TTD
addExternalUserId(ext.eids, bidRequest.userId.tdid, 'adserver.org', {
rtiPartner: 'TDID'
});
// digitrust
const digitrustResponse = bidRequest.userId.digitrustid;
if (digitrustResponse && digitrustResponse.data) {
var digitrust = {};
if (digitrustResponse.data.id) {
digitrust.id = digitrustResponse.data.id;
}
if (digitrustResponse.data.keyv) {
digitrust.keyv = digitrustResponse.data.keyv;
}
ext.digitrust = digitrust;
}
let eids = bidRequest.userIdAsEids;
if (eids) {
ext.eids = eids;
}
}
return { ext };
}

/**
* Produces external userid object in ortb 3.0 model.
*/
function addExternalUserId(eids, id, source, uidExt) {
if (id) {
var uid = { id };
if (uidExt) {
uid.ext = uidExt;
}
eids.push({
source,
uids: [ uid ]
});
}
}

/**
* Produces the regulations ortb object
*/
Expand Down
92 changes: 16 additions & 76 deletions test/spec/modules/pulsepointBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {expect} from 'chai';
import {spec} from 'modules/pulsepointBidAdapter.js';
import {deepClone} from 'src/utils.js';
import { config } from 'src/config.js';

describe('PulsePoint Adapter Tests', function () {
const slotConfigs = [{
Expand Down Expand Up @@ -615,70 +616,21 @@ describe('PulsePoint Adapter Tests', function () {
});
it('Verify common id parameters', function () {
const bidRequests = deepClone(slotConfigs);
bidRequests[0].userId = {
pubcid: 'userid_pubcid',
tdid: 'userid_ttd',
digitrustid: {
data: {
id: 'userid_digitrust',
keyv: 4,
privacy: {optout: false},
producer: 'ABC',
version: 2
bidRequests[0].userIdAsEids = [{
source: 'pubcid.org',
uids: [{
id: 'userid_pubcid'
}]
}, {
source: 'adserver.org',
uids: [{
id: 'userid_ttd',
ext: {
rtiPartner: 'TDID'
}
}
};
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request).to.be.not.null;
const ortbRequest = request.data;
expect(request.data).to.be.not.null;
// user object
expect(ortbRequest.user).to.not.be.undefined;
expect(ortbRequest.user.ext).to.not.be.undefined;
expect(ortbRequest.user.ext.eids).to.not.be.undefined;
expect(ortbRequest.user.ext.eids).to.have.lengthOf(2);
expect(ortbRequest.user.ext.eids[0].source).to.equal('pubcid.org');
expect(ortbRequest.user.ext.eids[0].uids).to.have.lengthOf(1);
expect(ortbRequest.user.ext.eids[0].uids[0].id).to.equal('userid_pubcid');
expect(ortbRequest.user.ext.eids[1].source).to.equal('adserver.org');
expect(ortbRequest.user.ext.eids[1].uids).to.have.lengthOf(1);
expect(ortbRequest.user.ext.eids[1].uids[0].id).to.equal('userid_ttd');
expect(ortbRequest.user.ext.eids[1].uids[0].ext).to.not.be.null;
expect(ortbRequest.user.ext.eids[1].uids[0].ext.rtiPartner).to.equal('TDID');
expect(ortbRequest.user.ext.digitrust).to.not.be.null;
expect(ortbRequest.user.ext.digitrust.id).to.equal('userid_digitrust');
expect(ortbRequest.user.ext.digitrust.keyv).to.equal(4);
});
it('Verify new external user id partners', function () {
const bidRequests = deepClone(slotConfigs);
bidRequests[0].userId = {
britepoolid: 'britepool_id123',
criteoId: 'criteo_id234',
idl_env: 'idl_id123',
id5id: { uid: 'id5id_234' },
parrableId: { eid: 'parrable_id234' },
lipb: {
lipbid: 'liveintent_id123'
},
haloId: {
haloId: 'halo_user1'
},
lotamePanoramaId: 'lotame_user2',
merkleId: 'merkle_user3',
fabrickId: 'fabrick_user4',
connectid: 'connect_user5',
uid2: {
id: 'uid2_user6'
}
};
const userVerify = function(obj, source, id) {
expect(obj).to.deep.equal({
source,
uids: [{
id
}]
});
};
}]
}
];
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request).to.be.not.null;
const ortbRequest = request.data;
Expand All @@ -687,19 +639,7 @@ describe('PulsePoint Adapter Tests', function () {
expect(ortbRequest.user).to.not.be.undefined;
expect(ortbRequest.user.ext).to.not.be.undefined;
expect(ortbRequest.user.ext.eids).to.not.be.undefined;
expect(ortbRequest.user.ext.eids).to.have.lengthOf(12);
userVerify(ortbRequest.user.ext.eids[0], 'britepool.com', 'britepool_id123');
userVerify(ortbRequest.user.ext.eids[1], 'criteo.com', 'criteo_id234');
userVerify(ortbRequest.user.ext.eids[2], 'liveramp.com', 'idl_id123');
userVerify(ortbRequest.user.ext.eids[3], 'id5-sync.com', 'id5id_234');
userVerify(ortbRequest.user.ext.eids[4], 'parrable.com', 'parrable_id234');
userVerify(ortbRequest.user.ext.eids[5], 'neustar.biz', 'fabrick_user4');
userVerify(ortbRequest.user.ext.eids[6], 'audigent.com', 'halo_user1');
userVerify(ortbRequest.user.ext.eids[7], 'merkleinc.com', 'merkle_user3');
userVerify(ortbRequest.user.ext.eids[8], 'crwdcntrl.net', 'lotame_user2');
userVerify(ortbRequest.user.ext.eids[9], 'verizonmedia.com', 'connect_user5');
userVerify(ortbRequest.user.ext.eids[10], 'uidapi.com', 'uid2_user6');
userVerify(ortbRequest.user.ext.eids[11], 'liveintent.com', 'liveintent_id123');
expect(ortbRequest.user.ext.eids).to.deep.equal(bidRequests[0].userIdAsEids);
});
it('Verify multiple adsizes', function () {
const bidRequests = deepClone(slotConfigs);
Expand Down