diff --git a/includes/components/pagetemplate.class.php b/includes/components/pagetemplate.class.php index c635a40d..eb2e35c9 100644 --- a/includes/components/pagetemplate.class.php +++ b/includes/components/pagetemplate.class.php @@ -470,16 +470,18 @@ class PageTemplate private function update() : void { // analytics + consent - if ($this->hasAnalytics && !isset($_COOKIE['consent'])) + // not set or declined + if (empty($_COOKIE['consent'])) + $this->hasAnalytics = false; + + // not set + if (!isset($_COOKIE['consent'])) { $this->addScript(SC_CSS_FILE, 'css/consent.css', SC_FLAG_NOCACHE); $this->addScript(SC_JS_FILE, 'js/consent.js', SC_FLAG_NOCACHE); $this->consentFooter = true; - $this->hasAnalytics = false; } - else if ($this->hasAnalytics && !$_COOKIE['consent']) - $this->hasAnalytics = false; // js + css $this->prepareScripts();