Skip to content

Commit

Permalink
adding ccpa support for appnexus bid adapter (#4531)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaiminpanchal27 authored and jsnellbaker committed Dec 4, 2019
1 parent 484beb2 commit 2450f2f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ export const spec = {
};
}

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

if (bidderRequest && bidderRequest.refererInfo) {
let refererinfo = {
rd_ref: encodeURIComponent(bidderRequest.refererInfo.referer),
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,24 @@ describe('AppNexusAdapter', function () {
expect(payload.gdpr_consent.consent_required).to.exist.and.to.be.true;
});

it('should add us privacy string to payload', function() {
let consentString = '1YA-';
let bidderRequest = {
'bidderCode': 'appnexus',
'auctionId': '1d1a030790a475',
'bidderRequestId': '22edbae2733bf6',
'timeout': 3000,
'uspConsent': consentString
};
bidderRequest.bids = bidRequests;

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

expect(payload.us_privacy).to.exist;
expect(payload.us_privacy).to.exist.and.to.equal(consentString);
});

it('supports sending hybrid mobile app parameters', function () {
let appRequest = Object.assign({},
bidRequests[0],
Expand Down

0 comments on commit 2450f2f

Please sign in to comment.