Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexExchange Bid Adapter: Added support for netID, ID+ and FabrickId userId #6286

Merged
merged 14 commits into from
Feb 17, 2021
Merged
12 changes: 12 additions & 0 deletions modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,18 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) {
if (userId.idl_env) {
addUserEids(userEids, seenIdPartners, userId.idl_env, 'liveramp.com', 'LiveRampIp', 'idl');
}

if (userId.netId) {
addUserEids(userEids, seenIdPartners, userId.netId, 'netid.de', 'NetIdIp', 'NETID');
}

if (userId.fabrickId) {
addUserEids(userEids, seenIdPartners, userId.fabrickId, 'neustar.biz', 'NeustarIp', 'fabrickId');
}

if (userId.IDP) {
addUserEids(userEids, seenIdPartners, userId.IDP, 'zeotap.com', 'ZeotapIp', 'zeotapIdPlus');
}
}

// RTI ids will be included in the bid request if the function getIdentityInfo() is loaded
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 74 additions & 4 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ describe('IndexexchangeAdapter', function () {

const DEFAULT_USERID_DATA = {
idl_env: '1234-5678-9012-3456', // Liveramp
netId: 'testnetid123', // NetId
IDP: 'userIDP000', // IDP
fabrickId: 'fabrickId9000', // FabrickId
};

const DEFAULT_USERID_PAYLOAD = [
Expand All @@ -362,6 +365,30 @@ describe('IndexexchangeAdapter', function () {
rtiPartner: 'idl'
}
}]
}, {
source: 'netid.de',
uids: [{
id: DEFAULT_USERID_DATA.netId,
ext: {
rtiPartner: 'NETID'
}
}]
}, {
source: 'neustar.biz',
uids: [{
id: DEFAULT_USERID_DATA.fabrickId,
ext: {
rtiPartner: 'fabrickId'
}
}]
}, {
source: 'zeotap.com',
uids: [{
id: DEFAULT_USERID_DATA.IDP,
ext: {
rtiPartner: 'zeotapIdPlus'
}
}]
}
];

Expand Down Expand Up @@ -761,14 +788,17 @@ describe('IndexexchangeAdapter', function () {
delete window.headertag;
});

it('IX adapter reads LiveRamp IDL envelope from Prebid and adds it to Video', function () {
it('IX adapter reads supported user modules from Prebid and adds it to Video', function () {
const cloneValidBid = utils.deepClone(DEFAULT_VIDEO_VALID_BID);
cloneValidBid[0].userId = utils.deepClone(DEFAULT_USERID_DATA);
const request = spec.buildRequests(cloneValidBid, DEFAULT_OPTION)[0];
const payload = JSON.parse(request.data.r);

expect(payload.user.eids).to.have.lengthOf(1);
expect(payload.user.eids).to.have.lengthOf(4);
expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[0]);
expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[1]);
expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[2]);
expect(payload.user.eids).to.deep.include(DEFAULT_USERID_PAYLOAD[3]);
});

it('We continue to send in IXL identity info and Prebid takes precedence over IXL', function () {
Expand Down Expand Up @@ -822,6 +852,39 @@ describe('IndexexchangeAdapter', function () {
}
}
]
},
NetIdIp: {
source: 'netid.de',
uids: [
{
id: 'testnetid',
ext: {
rtiPartner: 'NETID'
}
}
]
},
NeustarIp: {
source: 'neustar.biz',
uids: [
{
id: 'testfabrick',
ext: {
rtiPartner: 'fabrickId'
}
}
]
},
ZeotapIp: {
source: 'zeotap.com',
uids: [
{
id: 'testzeotap',
ext: {
rtiPartner: 'zeotapIdPlus'
}
}
]
}
};

Expand Down Expand Up @@ -867,10 +930,14 @@ describe('IndexexchangeAdapter', function () {
})

expect(payload.user).to.exist;
expect(payload.user.eids).to.have.lengthOf(3);
expect(payload.user.eids).to.have.lengthOf(6);

expect(payload.user.eids).to.deep.include(validUserIdPayload[0]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[1]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[2]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[3]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[4]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[5]);
});

it('IXL and Prebid are mutually exclusive', function () {
Expand Down Expand Up @@ -910,9 +977,12 @@ describe('IndexexchangeAdapter', function () {
});

const payload = JSON.parse(request.data.r);
expect(payload.user.eids).to.have.lengthOf(2);
expect(payload.user.eids).to.have.lengthOf(5);
expect(payload.user.eids).to.deep.include(validUserIdPayload[0]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[1]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[2]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[3]);
expect(payload.user.eids).to.deep.include(validUserIdPayload[4]);
});
});

Expand Down