Skip to content

Commit

Permalink
add uid2 to OpenX Bid Adapter (prebid#7015)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwschmidt authored and agrandes-tappx committed Sep 29, 2021
1 parent 207b5f9 commit 9af9d51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const USER_ID_CODE_TO_QUERY_ARG = {
quantcastId: 'quantcastid', // Quantcast ID
tapadId: 'tapadid', // Tapad Id
tdid: 'ttduuid', // The Trade Desk Unified ID
verizonMediaId: 'verizonmediaid', // Verizon Media ConnectID
uid2: 'uid2', // Unified ID 2.0
};

export const spec = {
Expand Down Expand Up @@ -291,6 +291,9 @@ function appendUserIdsToQueryParams(queryParams, userIds) {

if (USER_ID_CODE_TO_QUERY_ARG.hasOwnProperty(userIdProviderKey)) {
switch (userIdProviderKey) {
case 'uid2':
queryParams[key] = userIdObjectOrValue.id;
break;
case 'lipb':
queryParams[key] = userIdObjectOrValue.lipbid;
break;
Expand Down
5 changes: 4 additions & 1 deletion test/spec/modules/openxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ describe('OpenxAdapter', function () {
quantcastId: '1111-quantcastid',
tapadId: '111-tapadid',
tdid: '1111-tdid',
verizonMediaId: '1111-verizonmediaid',
uid2: {id: '1111-uid2'}
};

// generates the same set of tests for each id provider
Expand Down Expand Up @@ -1104,6 +1104,9 @@ describe('OpenxAdapter', function () {
let userIdValue;
// handle cases where userId key refers to an object
switch (userIdProviderKey) {
case 'uid2':
userIdValue = EXAMPLE_DATA_BY_ATTR.uid2.id;
break;
case 'lipb':
userIdValue = EXAMPLE_DATA_BY_ATTR.lipb.lipbid;
break;
Expand Down

0 comments on commit 9af9d51

Please sign in to comment.