dbFields = array( 'enabled'=>true, 'message'=>'Allow to Google Analytics tracking you?' ); } public function form() { global $Language; $html = '
'; $html .= ''; $html .= ''; $html .= 'Show the consent to the user before loading the script of Google Analytics. The user can reject be tracked for Google Analytics.'; $html .= '
'; return $html; } public function siteHead() { $html = ''; return $html; } public function siteBodyBegin() { $script = << function pluginGDPRCookie_allowTracking() { setCookie("BLUDIT_GDPR_ALLOW_TRACKING", true, 7); pluginGDPRCookie_hideModal(); } function pluginGDPRCookie_disableTracking() { setCookie("BLUDIT_GDPR_ALLOW_TRACKING", false, 7); pluginGDPRCookie_hideModal(); } function pluginGDPRCookie_hideModal() { document.getElementById("pluginGDPRCookie").style.display = "none"; } EOT; if ($this->getValue('enabled')) { $html = '
'; $html .= '
Allow to Google Analytics tracking you?
'; $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; $html .= '
'; } else { $html = ''; } $script .= ' '; return $script.$html; } }