Skip to content

Commit 3d37668

Browse files
jackhsiehucfrootRyanChouTwucfunneljack.hsieh
authored
ucfunnel Bid Adapter: add support for FLoC and Verizon Media ConnectID (#6744)
* Add a new ucfunnel Adapter and test page * Add a new ucfunnel Adapter and test page * 1. Use prebid lib in the repo to keep updated 2. Replace var with let 3. Put JSON.parse(JSON.stringify()) into try catch block * utils.getTopWindowLocation is a function * Change to modules from adapters * Migrate to module design * [Dev Fix] Remove width and height which can be got from ad unit id * Update ucfunnelBidAdapter to fit into new spec * Correct the endpoint. Fix the error of query string * Add test case for ucfunnelBidAdapter * Fix lint error * Update version number * Combine all checks on bid request * Add GDPR support for ucfunnel adapter * Add in-stream video and native support for ucfunnel adapter * Remove demo page. Add more test cases. * Change request method from POST to GET * Remove unnecessary comment * Support vastXml and vastUrl for video request * update TTL to 30 mins * Avoid using arrow function which is not discuraged in mocha * ucfunnel tdid support * ucfunnel fix error message in debug mode * ucfunnel adapter add bidfloor parameter * ucfunnel adapter support CCPA * ucfunnel adapter native support clicktrackers * ucfunnel adapter change cookie sync setting * ucfunnel adapter update request parameter * Update ucfunnelBidAdapter * ucfunnel adapter add currency in ad response * ucfunnel adapter support uid2 * ucfunnel Bid Adapter: add support for FLoC and Verizon Media ConnectID Co-authored-by: root <[email protected]> Co-authored-by: Ryan Chou <[email protected]> Co-authored-by: ucfunnel <[email protected]> Co-authored-by: jack.hsieh <[email protected]>
1 parent ea6d7d6 commit 3d37668

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

modules/ucfunnelBidAdapter.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ function getRequestData(bid, bidderRequest) {
300300
}
301301

302302
function addUserId(bidData, userId) {
303+
bidData['eids'] = '';
303304
utils._each(userId, (userIdObjectOrValue, userIdProviderKey) => {
304305
switch (userIdProviderKey) {
305306
case 'sharedid':
@@ -333,7 +334,21 @@ function addUserId(bidData, userId) {
333334
break;
334335
case 'uid2':
335336
if (userIdObjectOrValue.id) {
336-
bidData['eids'] = userIdProviderKey + ',' + userIdObjectOrValue.id
337+
bidData['eids'] = (bidData['eids'].length > 0)
338+
? (bidData['eids'] + '!' + userIdProviderKey + ',' + userIdObjectOrValue.id)
339+
: (userIdProviderKey + ',' + userIdObjectOrValue.id);
340+
}
341+
break;
342+
case 'connectid':
343+
if (userIdObjectOrValue) {
344+
bidData['eids'] = (bidData['eids'].length > 0)
345+
? (bidData['eids'] + '!verizonMediaId,' + userIdObjectOrValue)
346+
: ('verizonMediaId,' + userIdObjectOrValue);
347+
}
348+
break;
349+
case 'flocId':
350+
if (userIdObjectOrValue.id) {
351+
bidData['cid'] = userIdObjectOrValue.id;
337352
}
338353
break;
339354
default:

test/spec/modules/ucfunnelBidAdapter_spec.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const userId = {
1717
'sharedid': {'id': '01ESHXW4HD29KMF387T63JQ9H5', 'third': '01ESHXW4HD29KMF387T63JQ9H5'},
1818
'tdid': 'D6885E90-2A7A-4E0F-87CB-7734ED1B99A3',
1919
'haloId': {},
20-
'uid2': {'id': 'eb33b0cb-8d35-4722-b9c0-1a31d4064888'}
20+
'uid2': {'id': 'eb33b0cb-8d35-4722-b9c0-1a31d4064888'},
21+
'flocId': {'id': '12144', 'version': 'chrome.1.1'},
22+
'connectid': '4567'
2123
}
2224

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

0 commit comments

Comments
 (0)