Skip to content

Commit

Permalink
appnexus bid adapter - add support for pubProvidedId userId (prebid#8015
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jsnellbaker authored Feb 28, 2022
1 parent dfab600 commit 00e0bb5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 26 additions & 1 deletion test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}]
}]
}
});

Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit 00e0bb5

Please sign in to comment.