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

GumGum: adds us privacy (CCPA) support #4581

Merged
merged 2 commits into from
Jan 2, 2020
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
4 changes: 4 additions & 0 deletions modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ function isBidRequestValid (bid) {
function buildRequests (validBidRequests, bidderRequest) {
const bids = [];
const gdprConsent = bidderRequest && bidderRequest.gdprConsent;
const uspConsent = bidderRequest && bidderRequest.uspConsent;
utils._each(validBidRequests, bidRequest => {
const timeout = config.getConfig('bidderTimeout');
const {
Expand Down Expand Up @@ -198,6 +199,9 @@ function buildRequests (validBidRequests, bidderRequest) {
if (data.gdprApplies) {
data.gdprConsent = gdprConsent.consentString;
}
if (uspConsent) {
data.uspConsent = uspConsent;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the param should be us_privacy

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, although the IAB spec for USP/CCPA suggests us_privacy as the industry standard, you're not required to use that parameter for your endpoint.

}
if (schain && schain.nodes) {
data.schain = _serializeSupplyChainObj(schain);
}
Expand Down
10 changes: 9 additions & 1 deletion test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('gumgumAdapter', function () {
expect(request.data).to.not.include.any.keys('eAdBuyId');
expect(request.data).to.not.include.any.keys('adBuyId');
});
it('should add consent parameters if gdprConsent is present', function () {
it('should add gdpr consent parameters if gdprConsent is present', function () {
const gdprConsent = { consentString: 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==', gdprApplies: true };
const fakeBidRequest = { gdprConsent: gdprConsent };
const bidRequest = spec.buildRequests(bidRequests, fakeBidRequest)[0];
Expand All @@ -159,6 +159,14 @@ describe('gumgumAdapter', function () {
const bidRequest = spec.buildRequests(bidRequests, fakeBidRequest)[0];
expect(bidRequest.data).to.not.include.any.keys('gdprConsent')
});
it('should add uspConsent parameter if it is present in the bidderRequest', function () {
const noUspBidRequest = spec.buildRequests(bidRequests)[0];
const uspConsentObj = { uspConsent: '1YYY' };
const bidRequest = spec.buildRequests(bidRequests, uspConsentObj)[0];
expect(noUspBidRequest.data).to.not.include.any.keys('uspConsent');
expect(bidRequest.data).to.include.any.keys('uspConsent');
expect(bidRequest.data.uspConsent).to.eq(uspConsentObj.uspConsent);
});
it('should add a tdid parameter if request contains unified id from TradeDesk', function () {
const unifiedId = {
'userId': {
Expand Down