Skip to content

Commit

Permalink
appnexus bid adapter: criteo back to tpuids (#5808)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored Oct 1, 2020
1 parent c1c6aaa commit 804ff2f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,17 @@ export const spec = {
});
}

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

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

it('should populate eids array when ttd id and criteo is available', function () {
it('should populate eids and tpuids when ttd id and criteo is available', function () {
const bidRequest = Object.assign({}, bidRequests[0], {
userId: {
tdid: 'sample-userid',
Expand All @@ -824,9 +824,9 @@ 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 804ff2f

Please sign in to comment.