diff --git a/Application/views/admin/tpl/d3googleanalytics4_main.tpl b/Application/views/admin/tpl/d3googleanalytics4_main.tpl
index a2731ce..abb8c26 100644
--- a/Application/views/admin/tpl/d3googleanalytics4_main.tpl
+++ b/Application/views/admin/tpl/d3googleanalytics4_main.tpl
@@ -32,7 +32,7 @@
d3GetModuleConfigParam('_blEnableGa4')}]checked[{/if}] id="blGA4enab">
@@ -184,55 +184,4 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/Application/views/blocks/_gtm_js.tpl b/Application/views/blocks/_gtm_js.tpl
index 9b97924..090310c 100755
--- a/Application/views/blocks/_gtm_js.tpl
+++ b/Application/views/blocks/_gtm_js.tpl
@@ -1,9 +1,10 @@
[{* Always prepare the data layer to avoid errors *}]
-
-
-[{assign var="d3GtmContainerIdString" value=$oViewConf->getGtmContainerId()}]
+[{if $oViewConf->isGA4enabled()}]
+ [{assign var="d3GtmContainerIdString" value=$oViewConf->getGtmContainerId()}]
+
+[{/if}]
[{if $oViewConf->isGA4enabled() and $oViewConf->D3blShowGtmScript()}]
[{if $d3GtmContainerIdString}]
@@ -15,15 +16,15 @@
[{$oViewConf->d3GetModuleConfigParam('_sMeasurementCapabilities')|strip}]
[{else}]
function gtag() {
- dataLayer.push(arguments);
+ dataLayer.push(arguments);
}
gtag("consent", "default", {
- ad_user_data: "denied",
- ad_personalization: "denied",
- ad_storage: "denied",
- analytics_storage: "denied",
- wait_for_update: 2000
+ ad_user_data: "denied",
+ ad_personalization: "denied",
+ ad_storage: "denied",
+ analytics_storage: "denied",
+ wait_for_update: 2000
});
[{/if}]