Skip to content

Commit

Permalink
ucfunnel Bid Adapter: add support for FLoC and Verizon Media ConnectID
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhsiehucf committed May 12, 2021
1 parent 8eea4b5 commit d586739
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
17 changes: 16 additions & 1 deletion modules/ucfunnelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ function getRequestData(bid, bidderRequest) {
}

function addUserId(bidData, userId) {
bidData['eids'] = '';
utils._each(userId, (userIdObjectOrValue, userIdProviderKey) => {
switch (userIdProviderKey) {
case 'sharedid':
Expand Down Expand Up @@ -333,7 +334,21 @@ function addUserId(bidData, userId) {
break;
case 'uid2':
if (userIdObjectOrValue.id) {
bidData['eids'] = userIdProviderKey + ',' + userIdObjectOrValue.id
bidData['eids'] = (bidData['eids'].length > 0)
? (bidData['eids'] + ',' + userIdProviderKey + ',' + userIdObjectOrValue.id)
: (userIdProviderKey + ',' + userIdObjectOrValue.id);
}
break;
case 'connectid':
if (userIdObjectOrValue) {
bidData['eids'] = (bidData['eids'].length > 0)
? (bidData['eids'] + '!verizonMediaId,' + userIdObjectOrValue)
: ('verizonMediaId,' + userIdObjectOrValue);
}
break;
case 'flocId':
if (userIdObjectOrValue.id) {
bidData['cid'] = userIdObjectOrValue.id;
}
break;
default:
Expand Down
7 changes: 5 additions & 2 deletions test/spec/modules/ucfunnelBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const userId = {
'sharedid': {'id': '01ESHXW4HD29KMF387T63JQ9H5', 'third': '01ESHXW4HD29KMF387T63JQ9H5'},
'tdid': 'D6885E90-2A7A-4E0F-87CB-7734ED1B99A3',
'haloId': {},
'uid2': {'id': 'eb33b0cb-8d35-4722-b9c0-1a31d4064888'}
'uid2': {'id': 'eb33b0cb-8d35-4722-b9c0-1a31d4064888'},
'flocId': {'id': '12144', 'version': 'chrome.1.1'},
'connectid': '4567'
}

const validBannerBidReq = {
Expand Down Expand Up @@ -159,7 +161,8 @@ describe('ucfunnel Adapter', function () {
expect(data.adid).to.equal('ad-34BBD2AA24B678BBFD4E7B9EE3B872D');
expect(data.w).to.equal(width);
expect(data.h).to.equal(height);
expect(data.eids).to.equal('uid2,eb33b0cb-8d35-4722-b9c0-1a31d4064888');
expect(data.eids).to.equal('uid2,eb33b0cb-8d35-4722-b9c0-1a31d4064888!verizonMediaId,4567');
expect(data.cid).to.equal('12144');
expect(data.schain).to.equal('1.0,1!exchange1.com,1234,1,bid-request-1,publisher,publisher.com');
});

Expand Down

0 comments on commit d586739

Please sign in to comment.