From 86c1b4c7717c413b89c2834e775dba9bc331f003 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Fri, 4 Feb 2022 12:30:51 -0500 Subject: [PATCH] appnexus bid adapter - add support for pubProvidedId userId --- modules/appnexusBidAdapter.js | 7 +++++ test/spec/modules/appnexusBidAdapter_spec.js | 27 +++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index dc2eadbfee9..ed044ca7777 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -270,6 +270,13 @@ export const spec = { addUserId(eids, deepAccess(bidRequests[0], `userId.idl_env`), 'liveramp.com', null); addUserId(eids, deepAccess(bidRequests[0], `userId.tdid`), 'adserver.org', 'TDID'); addUserId(eids, deepAccess(bidRequests[0], `userId.uid2.id`), 'uidapi.com', 'UID2'); + if (bidRequests[0].userId.pubProvidedId) { + bidRequests[0].userId.pubProvidedId.forEach(ppId => { + ppId.uids.forEach(uid => { + eids.push({ source: ppId.source, id: uid.id }); + }); + }); + } if (eids.length) { payload.eids = eids; diff --git a/test/spec/modules/appnexusBidAdapter_spec.js b/test/spec/modules/appnexusBidAdapter_spec.js index 2cf65bc8a59..75bfffea38b 100644 --- a/test/spec/modules/appnexusBidAdapter_spec.js +++ b/test/spec/modules/appnexusBidAdapter_spec.js @@ -943,7 +943,22 @@ describe('AppNexusAdapter', function () { flocId: { id: 'sample-flocid-value', version: 'chrome.1.0' - } + }, + pubProvidedId: [{ + source: 'puburl.com', + uids: [{ + id: 'pubid1', + atype: 1, + ext: { + stype: 'ppuid' + } + }] + }, { + source: 'puburl2.com', + uids: [{ + id: 'pubid2' + }] + }] } }); @@ -980,6 +995,16 @@ describe('AppNexusAdapter', function () { id: 'sample-uid2-value', rti_partner: 'UID2' }); + + expect(payload.eids).to.deep.include({ + source: 'puburl.com', + id: 'pubid1' + }); + + expect(payload.eids).to.deep.include({ + source: 'puburl2.com', + id: 'pubid2' + }); }); it('should populate iab_support object at the root level if omid support is detected', function () {