From ff58d7e816a7bd1ccc0ea25a928f3186e5094a2f Mon Sep 17 00:00:00 2001 From: Swati Mukherjee Date: Thu, 5 Dec 2024 22:53:21 +0530 Subject: [PATCH] fix no cookie preference in stage (#3309) --- libs/martech/helpers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/martech/helpers.js b/libs/martech/helpers.js index 25760ba57a..8ac87e40c6 100644 --- a/libs/martech/helpers.js +++ b/libs/martech/helpers.js @@ -352,7 +352,10 @@ function updateAMCVCookie(ECID) { */ export const loadAnalyticsAndInteractionData = async ({ locale, env, calculatedTimeout }) => { const value = getCookie('kndctr_9E1005A551ED61CA0A490D45_AdobeOrg_consent', true); - if (value?.[1] === 'general' && value?.[2] === 'out') { + const isRejectedDecodedURI = value?.[2] === undefined && decodeURIComponent(value?.[1]) === 'general=out'; + const isRejectedURI = value?.[1] === 'general' && value?.[2] === 'out'; + + if (isRejectedDecodedURI || isRejectedURI) { return Promise.reject(new Error('Consent Cookie doesnt allow interact')); }