Skip to content

Commit 70d3e13

Browse files
haruka-yamashita2JacobKlein26
authored andcommitted
support for ID5 (prebid#8712)
1 parent 811b809 commit 70d3e13

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

modules/yieldoneBidAdapter.js

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ export const spec = {
8080
payload.fuuid = dacId;
8181
}
8282

83+
// ID5
84+
const id5id = deepAccess(bidRequest, 'userId.id5id.uid');
85+
if (isStr(id5id) && !isEmpty(id5id)) {
86+
payload.id5Id = id5id;
87+
}
88+
8389
return {
8490
method: 'GET',
8591
url: ENDPOINT_URL,

test/spec/modules/yieldoneBidAdapter_spec.js

+33
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,39 @@ describe('yieldoneBidAdapter', function() {
436436
expect(request[0].data.fuuid).to.equal('dacId_sample');
437437
});
438438
});
439+
440+
describe('ID5', function () {
441+
it('dont send ID5 if undefined', function () {
442+
const bidRequests = [
443+
{
444+
params: {placementId: '0'},
445+
},
446+
{
447+
params: {placementId: '1'},
448+
userId: {},
449+
},
450+
{
451+
params: {placementId: '2'},
452+
userId: undefined,
453+
},
454+
];
455+
const request = spec.buildRequests(bidRequests, bidderRequest);
456+
expect(request[0].data).to.not.have.property('id5Id');
457+
expect(request[1].data).to.not.have.property('id5Id');
458+
expect(request[2].data).to.not.have.property('id5Id');
459+
});
460+
461+
it('should send ID5 if available', function () {
462+
const bidRequests = [
463+
{
464+
params: {placementId: '0'},
465+
userId: {id5id: {uid: 'id5id_sample'}},
466+
},
467+
];
468+
const request = spec.buildRequests(bidRequests, bidderRequest);
469+
expect(request[0].data.id5Id).to.equal('id5id_sample');
470+
});
471+
});
439472
});
440473

441474
describe('interpretResponse', function () {

0 commit comments

Comments
 (0)