Skip to content

Commit

Permalink
Add Teads US Privacy (#4658)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Souche authored and jsnellbaker committed Dec 20, 2019
1 parent 39a57ba commit 861e0bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/teadsBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ export const spec = {
};
}

if (bidderRequest && bidderRequest.uspConsent) {
payload.us_privacy = bidderRequest.uspConsent
}

const payloadString = JSON.stringify(payload);
return {
method: 'POST',
Expand Down
16 changes: 16 additions & 0 deletions test/spec/modules/teadsBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,22 @@ describe('teadsBidAdapter', () => {
expect(request.method).to.equal('POST');
});

it('should send US Privacy to endpoint', function() {
let usPrivacy = 'OHHHFCP1'
let bidderRequest = {
'auctionId': '1d1a030790a475',
'bidderRequestId': '22edbae2733bf6',
'timeout': 3000,
'uspConsent': usPrivacy
};

const request = spec.buildRequests(bidRequests, bidderRequest);
const payload = JSON.parse(request.data);

expect(payload.us_privacy).to.exist;
expect(payload.us_privacy).to.equal(usPrivacy);
});

it('should send GDPR to endpoint', function() {
let consentString = 'JRJ8RKfDeBNsERRDCSAAZ+A==';
let bidderRequest = {
Expand Down

0 comments on commit 861e0bd

Please sign in to comment.