Skip to content

Commit

Permalink
Appnexus - Send CriteoId in eids array. (#6025)
Browse files Browse the repository at this point in the history
* send criteo id in eids array

* remove a line space
  • Loading branch information
Fawke authored Nov 25, 2020
1 parent 678ffdf commit 99fe1a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,20 @@ export const spec = {
}

const criteoId = utils.deepAccess(bidRequests[0], `userId.criteoId`);
let eids = [];
if (criteoId) {
let tpuids = [];
tpuids.push({
'provider': 'criteo',
'user_id': criteoId
});
eids.push({
source: 'criteo.com',
id: criteoId
});
payload.tpuids = tpuids;
}

let eids = [];
const tdid = utils.deepAccess(bidRequests[0], `userId.tdid`);
if (tdid) {
eids.push({
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,11 @@ describe('AppNexusAdapter', function () {
rti_partner: 'TDID'
});

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

expect(payload.tpuids).to.deep.include({
provider: 'criteo',
user_id: 'sample-criteo-userid',
Expand Down

0 comments on commit 99fe1a7

Please sign in to comment.