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 for legacy #4663

Merged
merged 1 commit into from
Dec 30, 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 @@ -136,6 +136,10 @@ export const spec = {
payload.userid = JSON.stringify(validBidRequests[0].userId);
}

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 @@ -230,7 +234,7 @@ export const spec = {
/**
* Register User Sync.
*/
getUserSyncs: (syncOptions, serverResponses) => {
getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => {
const syncs = [];
try {
if (syncOptions.pixelEnabled) {
Expand Down
9 changes: 8 additions & 1 deletion test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ describe('SonobiBidAdapter', function () {
'reachedTop': true,
'referer': 'http://example.com',
'stack': ['http://example.com']
}
},
uspConsent: 'someCCPAString'

};
it('should include the digitrust id and keyv', () => {
window.DigiTrust = {
Expand Down Expand Up @@ -539,6 +541,11 @@ describe('SonobiBidAdapter', function () {
expect(bidRequests.data.s).not.to.be.empty;
expect(bidRequests.data.userid).to.equal(undefined);
});

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 () {
Expand Down