diff --git a/modules/concertBidAdapter.js b/modules/concertBidAdapter.js index 398248bfeab..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 { getStorageManager } from '../src/storageManager.js'; +import { hasPurpose1Consent } from '../src/utils/gpdr.js'; const BIDDER_CODE = 'concert'; const CONCERT_ENDPOINT = 'https://bids.concert.io'; @@ -45,7 +46,7 @@ export const spec = { uspConsent: bidderRequest.uspConsent, gdprConsent: bidderRequest.gdprConsent } - } + }; payload.slots = validBidRequests.map(bidRequest => { let slot = { @@ -57,8 +58,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 +71,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 +103,7 @@ export const spec = { creativeId: bid.creativeId, netRevenue: bid.netRevenue, currency: bid.currency - } + }; }); if (debugTurnedOn() && serverBody.debug) { @@ -122,7 +124,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 +205,14 @@ 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') + const uspConsent = !(bidderRequest?.uspConsent === 'string' && + bidderRequest?.uspConsent[0] === '1' && + bidderRequest?.uspConsent[2].toUpperCase() === 'Y'); + + const gdprConsent = bidderRequest?.gdprConsent && hasPurpose1Consent(bidderRequest?.gdprConsent); + + return (uspConsent || gdprConsent); }