Skip to content

Commit aa6daf4

Browse files
davidwoodsandersenjsnellbaker
authored andcommitted
TripleLift: CCPA support (prebid#4628)
* Add IdentityLink support and fix UnifiedId. It appears we've been looking for UnifiedId userIds on the bidderRequest object, when they are found on bidRequests. This commit fixes that error, and adds support for IdentityLink. * change maintainer email to group * TripleLift: Sending schain (#1) * Sending schain * null -> undefined * Hardcode sync endpoint protocol * Switch to EB2 sync endpoint * Add support for image based user syncing * Rename endpoint variable * Add assertion * Add CCPA query param * Simplify check for usPrivacy argument
1 parent b051c0b commit aa6daf4

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

modules/tripleliftBidAdapter.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export const tripleliftAdapterSpec = {
4242
}
4343
}
4444

45+
if (bidderRequest && bidderRequest.uspConsent) {
46+
tlCall = utils.tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent);
47+
}
48+
4549
if (tlCall.lastIndexOf('&') === tlCall.length - 1) {
4650
tlCall = tlCall.substring(0, tlCall.length - 1);
4751
}
@@ -62,7 +66,7 @@ export const tripleliftAdapterSpec = {
6266
});
6367
},
6468

65-
getUserSyncs: function(syncOptions) {
69+
getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) {
6670
let syncType = _getSyncType(syncOptions);
6771
if (!syncType) return;
6872

@@ -78,6 +82,10 @@ export const tripleliftAdapterSpec = {
7882
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'cmp_cs', consentString);
7983
}
8084

85+
if (usPrivacy) {
86+
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'us_privacy', usPrivacy);
87+
}
88+
8189
return [{
8290
type: syncType,
8391
url: syncEndpoint

test/spec/modules/tripleliftBidAdapter_spec.js

+13
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ describe('triplelift adapter', function () {
236236
expect(url).to.match(new RegExp('(?:' + prebid.version + ')'))
237237
expect(url).to.match(/(?:referrer)/);
238238
});
239+
it('should return us_privacy param when CCPA info is available', function() {
240+
bidderRequest.uspConsent = '1YYY';
241+
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
242+
const url = request.url;
243+
expect(url).to.match(/(\?|&)us_privacy=1YYY/);
244+
});
239245
it('should return schain when present', function() {
240246
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
241247
const { data: payload } = request;
@@ -401,5 +407,12 @@ describe('triplelift adapter', function () {
401407
expect(result[0].type).to.equal('iframe');
402408
expect(result[0].url).to.equal(expectedIframeSyncUrl);
403409
});
410+
it('sends us_privacy param when info is available', function() {
411+
let syncOptions = {
412+
iframeEnabled: true
413+
};
414+
let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY');
415+
expect(result[0].url).to.match(/(\?|&)us_privacy=1YYY/);
416+
});
404417
});
405418
});

0 commit comments

Comments
 (0)