Skip to content

Commit

Permalink
appnexusBidAdapter - add support for netId userID (prebid#6114)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored and GeneGenie committed Jan 13, 2021
1 parent 08642aa commit 9a4dbd1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ export const spec = {
});
}

const netidId = utils.deepAccess(bidRequests[0], `userId.netId`);
if (netidId) {
eids.push({
source: 'netid.de',
id: netidId
});
}

const tdid = utils.deepAccess(bidRequests[0], `userId.tdid`);
if (tdid) {
eids.push({
Expand Down
10 changes: 8 additions & 2 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -822,11 +822,12 @@ describe('AppNexusAdapter', function () {
expect(request.options).to.deep.equal({withCredentials: false});
});

it('should populate eids when ttd id and criteo is available', function () {
it('should populate eids when supported userIds are available', function () {
const bidRequest = Object.assign({}, bidRequests[0], {
userId: {
tdid: 'sample-userid',
criteoId: 'sample-criteo-userid'
criteoId: 'sample-criteo-userid',
netId: 'sample-netId-userid'
}
});

Expand All @@ -842,6 +843,11 @@ describe('AppNexusAdapter', function () {
source: 'criteo.com',
id: 'sample-criteo-userid',
});

expect(payload.eids).to.deep.include({
source: 'netid.de',
id: 'sample-netId-userid',
});
});

it('should populate iab_support object at the root level if omid support is detected', function () {
Expand Down

0 comments on commit 9a4dbd1

Please sign in to comment.