Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonobi - added CCPA support to sonobi bidder adapter #4617

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/sonobiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -236,7 +240,7 @@ export const spec = {
/**
* Register User Sync.
*/
getUserSyncs: (syncOptions, serverResponses) => {
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
const syncs = [];
try {
if (syncOptions.pixelEnabled) {
Expand Down
10 changes: 8 additions & 2 deletions test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down