From ef29f7eb1bc4ec3c9630c3c091316421de2570b3 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Wed, 29 May 2024 12:16:22 +0200 Subject: [PATCH] [Added] additional check for properly activated module --- Application/views/blocks/_gtm_js.tpl | 2 +- Modules/Core/ViewConfig.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Application/views/blocks/_gtm_js.tpl b/Application/views/blocks/_gtm_js.tpl index 4ff4f37..5c4751c 100755 --- a/Application/views/blocks/_gtm_js.tpl +++ b/Application/views/blocks/_gtm_js.tpl @@ -5,7 +5,7 @@ [{assign var="d3GtmContainerIdString" value=$oViewConf->getGtmContainerId()}] -[{if $oViewConf->D3blShowGtmScript()}] +[{if $oViewConf->isGA4enabled() and $oViewConf->D3blShowGtmScript()}] [{if $d3GtmContainerIdString}] [{strip}] diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 282671e..6e80c00 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -73,6 +73,10 @@ class ViewConfig extends ViewConfig_parent /** @var Config $oConfig */ $oConfig = Registry::getConfig(); + if (false === $this->isGA4enabled()){ + return false; + } + // No Cookie Manager in use if (!$this->shallUseOwnCookieManager()) { return true;