From f765d65ad3777355128ef678d97f1abbfa5ea095 Mon Sep 17 00:00:00 2001 From: JonGoSonobi Date: Tue, 17 Dec 2019 15:34:36 -0500 Subject: [PATCH] added CCPA support to sonobi bidder adapter (#4617) --- modules/sonobiBidAdapter.js | 6 +++++- test/spec/modules/sonobiBidAdapter_spec.js | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index eea25d98d90..c77ab0ebd4f 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -142,6 +142,10 @@ export const spec = { payload.kw = keywords; } + if (bidderRequest && bidderRequest.uspConsent) { + payload.us_privacy = bidderRequest.uspConsent; + } + // If there is no key_maker data, then don't make the request. if (isEmpty(data)) { return null; @@ -236,7 +240,7 @@ export const spec = { /** * Register User Sync. */ - getUserSyncs: (syncOptions, serverResponses) => { + getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { const syncs = []; try { if (syncOptions.pixelEnabled) { diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index 52d755a1faf..33da707ae0d 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -300,7 +300,8 @@ describe('SonobiBidAdapter', function () { 'reachedTop': true, 'referer': 'https://example.com', 'stack': ['https://example.com'] - } + }, + uspConsent: 'someCCPAString' }; it('should include the digitrust id and keyv', () => { window.DigiTrust = { @@ -545,7 +546,12 @@ describe('SonobiBidAdapter', function () { const bidRequests = spec.buildRequests(bidRequest, bidderRequests); expect(bidRequests.data.kw).to.equal('sports,news,some_other_keyword'); }); - }) + + it('should return a properly formatted request with us_privacy included', function() { + const bidRequests = spec.buildRequests(bidRequest, bidderRequests); + expect(bidRequests.data.us_privacy).to.equal('someCCPAString'); + }); + }); describe('.interpretResponse', function () { const bidRequests = {