const getCookieValue = (name) => ( document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || '' ); function blockOrigin(value) { const preferences = Number(value[0]) const statistics = Number(value[1]) const marketing = Number(value[2]) if (!preferences) { } if (!statistics) { cookiesToBlock.push(/connect\.facebook\.net/); cookiesToBlock.push(/snap\.licdn\.com/); cookiesToBlock.push(/clarity\.ms/); cookiesToBlock.push(/static\.hotjar\.com/); cookiesToBlock.push(/demdex\.net/); } if(!marketing) { cookiesToBlock.push(/googleads\.g\.doubleclick\.net/); cookiesToBlock.push(/connect\.facebook\.net/); cookiesToBlock.push(/snap\.licdn\.com/); cookiesToBlock.push(/clarity\.ms/); cookiesToBlock.push(/static\.hotjar\.com/); cookiesToBlock.push(/demdex\.net/); cookiesToBlock.push(/everesttech\.net/); } } const purposes = getCookieValue('BCPurpose'); const consent = getCookieValue('BCConsent'); let cookiesToBlock = [] if (consent === '' || consent === 'false') { window.COOKIES_BLACKLIST = [ /connect\.facebook\.net/, /snap\.licdn\.com/, /clarity\.ms/, /static\.hotjar\.com/, /demdex\.net/, /googleads\.g\.doubleclick\.net/, /connect\.facebook\.net/, /snap\.licdn\.com/, /clarity\.ms/, /static\.hotjar\.com/, /demdex\.net/, /everesttech\.net/, ] } else if (consent === 'true') { blockOrigin(purposes); window.COOKIES_BLACKLIST = cookiesToBlock; }