Skip to content

Commit

Permalink
TripleLift: CCPA support (prebid#4628)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
davidwoodsandersen authored and jsnellbaker committed Dec 18, 2019
1 parent b051c0b commit aa6daf4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/tripleliftBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export const tripleliftAdapterSpec = {
}
}

if (bidderRequest && bidderRequest.uspConsent) {
tlCall = utils.tryAppendQueryString(tlCall, 'us_privacy', bidderRequest.uspConsent);
}

if (tlCall.lastIndexOf('&') === tlCall.length - 1) {
tlCall = tlCall.substring(0, tlCall.length - 1);
}
Expand All @@ -62,7 +66,7 @@ export const tripleliftAdapterSpec = {
});
},

getUserSyncs: function(syncOptions) {
getUserSyncs: function(syncOptions, responses, gdprConsent, usPrivacy) {
let syncType = _getSyncType(syncOptions);
if (!syncType) return;

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

if (usPrivacy) {
syncEndpoint = utils.tryAppendQueryString(syncEndpoint, 'us_privacy', usPrivacy);
}

return [{
type: syncType,
url: syncEndpoint
Expand Down
13 changes: 13 additions & 0 deletions test/spec/modules/tripleliftBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ describe('triplelift adapter', function () {
expect(url).to.match(new RegExp('(?:' + prebid.version + ')'))
expect(url).to.match(/(?:referrer)/);
});
it('should return us_privacy param when CCPA info is available', function() {
bidderRequest.uspConsent = '1YYY';
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
const url = request.url;
expect(url).to.match(/(\?|&)us_privacy=1YYY/);
});
it('should return schain when present', function() {
const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
const { data: payload } = request;
Expand Down Expand Up @@ -401,5 +407,12 @@ describe('triplelift adapter', function () {
expect(result[0].type).to.equal('iframe');
expect(result[0].url).to.equal(expectedIframeSyncUrl);
});
it('sends us_privacy param when info is available', function() {
let syncOptions = {
iframeEnabled: true
};
let result = tripleliftAdapterSpec.getUserSyncs(syncOptions, null, null, '1YYY');
expect(result[0].url).to.match(/(\?|&)us_privacy=1YYY/);
});
});
});

0 comments on commit aa6daf4

Please sign in to comment.