From fffb4454381d80f831a6b327528ab6d93c3babc0 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Tue, 12 Jul 2022 06:21:36 -0600 Subject: [PATCH 1/3] Concert Bid Adapter refererInfo update --- modules/concertBidAdapter.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/concertBidAdapter.js b/modules/concertBidAdapter.js index 398248bfeab..08a38cee0b4 100644 --- a/modules/concertBidAdapter.js +++ b/modules/concertBidAdapter.js @@ -1,6 +1,6 @@ import { logWarn, logMessage, debugTurnedOn, generateUUID } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { getStorageManager } from '../src/storageManager.js' +import { getStorageManager } from '../src/storageManager.js'; const BIDDER_CODE = 'concert'; const CONCERT_ENDPOINT = 'https://bids.concert.io'; @@ -45,7 +45,7 @@ export const spec = { uspConsent: bidderRequest.uspConsent, gdprConsent: bidderRequest.gdprConsent } - } + }; payload.slots = validBidRequests.map(bidRequest => { let slot = { @@ -57,8 +57,9 @@ export const spec = { slotType: bidRequest.params.slotType, adSlot: bidRequest.params.slot || bidRequest.adUnitCode, placementId: bidRequest.params.placementId || '', - site: bidRequest.params.site || bidderRequest.refererInfo.page - } + site: bidRequest.params.site || bidderRequest.refererInfo.page, + ref: bidderRequest.refererInfo.ref + }; return slot; }); @@ -69,7 +70,7 @@ export const spec = { method: 'POST', url: `${CONCERT_ENDPOINT}/bids/prebid`, data: JSON.stringify(payload) - } + }; }, /** * Unpack the response from the server into a list of bids. @@ -101,7 +102,7 @@ export const spec = { creativeId: bid.creativeId, netRevenue: bid.netRevenue, currency: bid.currency - } + }; }); if (debugTurnedOn() && serverBody.debug) { @@ -122,7 +123,7 @@ export const spec = { * @return {UserSync[]} The user syncs which should be dropped. */ getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) { - const syncs = [] + const syncs = []; if (syncOptions.iframeEnabled && !hasOptedOutOfPersonalization()) { let params = []; @@ -203,9 +204,9 @@ function hasOptedOutOfPersonalization() { * @param {BidderRequest} bidderRequest Object which contains any data consent signals */ function consentAllowsPpid(bidderRequest) { - /* NOTE: We cannot easily test GDPR consent, without the + /* NOTE: We can't easily test GDPR consent, without the * `consent-string` npm module; so will have to rely on that * happening on the bid-server. */ - return !(bidderRequest.uspConsent === 'string' && - bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY') + return !(bidderRequest.uspConsent === 'string' && + bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY'); } From 9ef93d842396997357f5b4d7b24b6ba89927ce35 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Tue, 12 Jul 2022 06:24:57 -0600 Subject: [PATCH 2/3] fix linting --- modules/concertBidAdapter.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/concertBidAdapter.js b/modules/concertBidAdapter.js index 08a38cee0b4..2a2cf49c88d 100644 --- a/modules/concertBidAdapter.js +++ b/modules/concertBidAdapter.js @@ -207,6 +207,5 @@ function consentAllowsPpid(bidderRequest) { /* NOTE: We can't easily test GDPR consent, without the * `consent-string` npm module; so will have to rely on that * happening on the bid-server. */ - return !(bidderRequest.uspConsent === 'string' && - bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY'); + return !(bidderRequest.uspConsent === 'string' && bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY'); } From 4d451920b68404f15c0eed59bc9595015c6f6956 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Mon, 25 Jul 2022 06:40:58 -0600 Subject: [PATCH 3/3] update with purpose1consent --- modules/concertBidAdapter.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/concertBidAdapter.js b/modules/concertBidAdapter.js index 2a2cf49c88d..fc6fc23c26d 100644 --- a/modules/concertBidAdapter.js +++ b/modules/concertBidAdapter.js @@ -1,6 +1,7 @@ import { logWarn, logMessage, debugTurnedOn, generateUUID } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; +import { hasPurpose1Consent } from '../src/utils/gpdr.js'; const BIDDER_CODE = 'concert'; const CONCERT_ENDPOINT = 'https://bids.concert.io'; @@ -207,5 +208,11 @@ function consentAllowsPpid(bidderRequest) { /* NOTE: We can't easily test GDPR consent, without the * `consent-string` npm module; so will have to rely on that * happening on the bid-server. */ - return !(bidderRequest.uspConsent === 'string' && bidderRequest.uspConsent.toUpperCase().substring(0, 2) === '1YY'); + const uspConsent = !(bidderRequest?.uspConsent === 'string' && + bidderRequest?.uspConsent[0] === '1' && + bidderRequest?.uspConsent[2].toUpperCase() === 'Y'); + + const gdprConsent = bidderRequest?.gdprConsent && hasPurpose1Consent(bidderRequest?.gdprConsent); + + return (uspConsent || gdprConsent); }