From 8d4007e3638f8055c5dfc6aca086b8206a87bcae Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Thu, 20 Aug 2020 06:40:34 -0400 Subject: [PATCH 1/5] remove cmpuishown event for tcf2 logic --- modules/consentManagement.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index 90fe24735db..c61587e97fc 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -104,8 +104,6 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { cmpSuccess(tcfData, hookConfig); } else if (tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') { cmpSuccess(tcfData, hookConfig); - } else if (tcfData.eventStatus === 'cmpuishown' && tcfData.tcString && tcfData.purposeOneTreatment === true) { - cmpSuccess(tcfData, hookConfig); } } else { cmpError('CMP unable to register callback function. Please check CMP setup.', hookConfig); From 08ce72c3dc548d5a3f1deb61118a7e8bd1a57f99 Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Wed, 26 Aug 2020 23:33:07 -0400 Subject: [PATCH 2/5] store consent on "cmpuishown" event --- modules/consentManagement.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index c61587e97fc..3908b798e89 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -104,6 +104,8 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { cmpSuccess(tcfData, hookConfig); } else if (tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') { cmpSuccess(tcfData, hookConfig); + } else if (tcfData.eventStatus === 'cmpuishown') { + cmpSuccess(tcfData); // store consent, but don't continue to next hook } } else { cmpError('CMP unable to register callback function. Please check CMP setup.', hookConfig); @@ -332,6 +334,20 @@ function processCmpData(consentObject, hookConfig) { utils.logInfo(`'allowAuctionWithoutConsent' using system default: (${DEFAULT_ALLOW_AUCTION_WO_CONSENT}).`); } + // if no hookConfig, store consent, but don't continue to next hook + if (!hookConfig) { + if (utils.isFn(checkFn)) { + if (checkFn(consentObject)) { + utils.logWarn('CMP returned unexpected value during lookup process.', consentObject); + } else { + storeConsentData(consentObject); + } + } else { + utils.logWarn('Unable to derive CMP version to process data. Consent object does not conform to TCF v1 or v2 specs.', consentObject); + } + return; + } + if (utils.isFn(checkFn)) { if (checkFn(consentObject)) { cmpFailed(`CMP returned unexpected value during lookup process.`, hookConfig, consentObject); From 10ae6959f9d5238ca0eb9895e984504275d3e853 Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Mon, 31 Aug 2020 15:43:20 -0400 Subject: [PATCH 3/5] reverted last consnetManagement cmpuishown commit --- modules/consentManagement.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index 3908b798e89..c61587e97fc 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -104,8 +104,6 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { cmpSuccess(tcfData, hookConfig); } else if (tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') { cmpSuccess(tcfData, hookConfig); - } else if (tcfData.eventStatus === 'cmpuishown') { - cmpSuccess(tcfData); // store consent, but don't continue to next hook } } else { cmpError('CMP unable to register callback function. Please check CMP setup.', hookConfig); @@ -334,20 +332,6 @@ function processCmpData(consentObject, hookConfig) { utils.logInfo(`'allowAuctionWithoutConsent' using system default: (${DEFAULT_ALLOW_AUCTION_WO_CONSENT}).`); } - // if no hookConfig, store consent, but don't continue to next hook - if (!hookConfig) { - if (utils.isFn(checkFn)) { - if (checkFn(consentObject)) { - utils.logWarn('CMP returned unexpected value during lookup process.', consentObject); - } else { - storeConsentData(consentObject); - } - } else { - utils.logWarn('Unable to derive CMP version to process data. Consent object does not conform to TCF v1 or v2 specs.', consentObject); - } - return; - } - if (utils.isFn(checkFn)) { if (checkFn(consentObject)) { cmpFailed(`CMP returned unexpected value during lookup process.`, hookConfig, consentObject); From d4103b14827abc8f3d010b3504037f53afa65699 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Tue, 1 Sep 2020 09:42:43 -0400 Subject: [PATCH 4/5] combine if statements --- modules/consentManagement.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index c61587e97fc..c282036adc6 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -100,11 +100,8 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { function v2CmpResponseCallback(tcfData, success) { utils.logInfo('Received a response from CMP', tcfData); if (success) { - if (tcfData.gdprApplies === false) { + if (tcfData.gdprApplies === false || tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') { cmpSuccess(tcfData, hookConfig); - } else if (tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') { - cmpSuccess(tcfData, hookConfig); - } } else { cmpError('CMP unable to register callback function. Please check CMP setup.', hookConfig); } From 2d298afdcfc155498e531b4636fca64703f2cdf3 Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Tue, 1 Sep 2020 10:12:21 -0400 Subject: [PATCH 5/5] fix typo --- modules/consentManagement.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/consentManagement.js b/modules/consentManagement.js index c282036adc6..519e32cfdf7 100644 --- a/modules/consentManagement.js +++ b/modules/consentManagement.js @@ -102,6 +102,7 @@ function lookupIabConsent(cmpSuccess, cmpError, hookConfig) { if (success) { if (tcfData.gdprApplies === false || tcfData.eventStatus === 'tcloaded' || tcfData.eventStatus === 'useractioncomplete') { cmpSuccess(tcfData, hookConfig); + } } else { cmpError('CMP unable to register callback function. Please check CMP setup.', hookConfig); }