From 648b08d1c415a8e6ae49eea0ee861e53aa34c4e8 Mon Sep 17 00:00:00 2001 From: Anand Venkatraman Date: Tue, 14 Sep 2021 16:26:01 -0400 Subject: [PATCH] PulsePoint Bid Adapter: support for additional user id providers (#7389) * ET-1691: Pulsepoint Analytics adapter for Prebid. (#1) * ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter * ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter * ET-1691: cleanup * ET-1691: minor * ET-1691: revert package.json change * Adding bidRequest to bidFactory.createBid method as per https://github.com/prebid/Prebid.js/issues/509 * ET-1765: Adding support for additional params in PulsePoint adapter (#2) * ET-1850: Fixing https://github.com/prebid/Prebid.js/issues/866 * Minor fix * Adding mandatory parameters to Bid * ET-9372: PulsePoint Adapter - support for additional user id providers * Fix for haloId --- modules/pulsepointBidAdapter.js | 12 ++++++--- .../spec/modules/pulsepointBidAdapter_spec.js | 26 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/modules/pulsepointBidAdapter.js b/modules/pulsepointBidAdapter.js index adea33fc3b9..5f8f096926b 100644 --- a/modules/pulsepointBidAdapter.js +++ b/modules/pulsepointBidAdapter.js @@ -421,12 +421,18 @@ function user(bidRequest, bidderRequest) { if (bidRequest) { if (bidRequest.userId) { ext.eids = []; - addExternalUserId(ext.eids, bidRequest.userId.pubcid, 'pubcommon'); + addExternalUserId(ext.eids, bidRequest.userId.pubcid, 'pubcid.org'); addExternalUserId(ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); - addExternalUserId(ext.eids, bidRequest.userId.criteoId, 'criteo'); - addExternalUserId(ext.eids, bidRequest.userId.idl_env, 'identityLink'); + addExternalUserId(ext.eids, bidRequest.userId.criteoId, 'criteo.com'); + addExternalUserId(ext.eids, bidRequest.userId.idl_env, 'liveramp.com'); addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.id5id.uid'), 'id5-sync.com', utils.deepAccess(bidRequest, 'userId.id5id.ext')); addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.parrableId.eid'), 'parrable.com'); + addExternalUserId(ext.eids, bidRequest.userId.fabrickId, 'neustar.biz'); + addExternalUserId(ext.eids, utils.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, utils.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'); diff --git a/test/spec/modules/pulsepointBidAdapter_spec.js b/test/spec/modules/pulsepointBidAdapter_spec.js index 6630cb0907c..92f7aa0b70d 100644 --- a/test/spec/modules/pulsepointBidAdapter_spec.js +++ b/test/spec/modules/pulsepointBidAdapter_spec.js @@ -637,7 +637,7 @@ describe('PulsePoint Adapter Tests', function () { 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('pubcommon'); + 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'); @@ -659,6 +659,16 @@ describe('PulsePoint Adapter Tests', function () { 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) { @@ -677,13 +687,19 @@ 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(6); + 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', 'criteo_id234'); - userVerify(ortbRequest.user.ext.eids[2], 'identityLink', 'idl_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], 'liveintent.com', 'liveintent_id123'); + 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'); }); it('Verify multiple adsizes', function () { const bidRequests = deepClone(slotConfigs);