diff --git a/Application/views/blocks/_gtm_js.tpl b/Application/views/blocks/_gtm_js.tpl index de0cb3e..8f8856f 100755 --- a/Application/views/blocks/_gtm_js.tpl +++ b/Application/views/blocks/_gtm_js.tpl @@ -13,7 +13,7 @@ w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'}); var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; - j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; + j.src = '[{$oViewConf->getServerSidetaggingJsDomain()}]?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]'); diff --git a/Application/views/blocks/_gtm_nojs.tpl b/Application/views/blocks/_gtm_nojs.tpl index 98a47ad..e15907e 100644 --- a/Application/views/blocks/_gtm_nojs.tpl +++ b/Application/views/blocks/_gtm_nojs.tpl @@ -2,7 +2,7 @@ [{if $oViewConf->getGtmContainerId()}][{strip}] diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index b6c5bb3..d8e6298 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -203,4 +203,30 @@ class ViewConfig extends ViewConfig_parent $oConfig = Registry::getConfig(); $aPromotionListIds = $oConfig->getConfigParam("") ?? ['bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross']; } + + /** + * @return string + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function getServerSidetaggingJsDomain() :string + { + return ContainerFactory::getInstance() + ->getContainer() + ->get(ModuleSettingBridgeInterface::class) + ->get('d3_gtm_settings_serversidetagging_js', 'd3googleanalytics4'); + } + + /** + * @return string + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function getServerSidetaggingNoJsDomain() :string + { + return ContainerFactory::getInstance() + ->getContainer() + ->get(ModuleSettingBridgeInterface::class) + ->get('d3_gtm_settings_serversidetagging_nojs', 'd3googleanalytics4'); + } } \ No newline at end of file diff --git a/metadata.php b/metadata.php index 6ffeebd..86c5b6e 100755 --- a/metadata.php +++ b/metadata.php @@ -210,5 +210,18 @@ $aModule = [ 'value' => 'none', 'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS|COOKIEFIRST|COOKIEBOT', ], + // OST929760 - Erweiterung für Serverside Tagging + [ + 'group' => 'd3_gtm_settings_serversidetagging', + 'name' => 'd3_gtm_settings_serversidetagging_js', + 'type' => 'str', + 'value' => 'https://www.googletagmanager.com/gtm.js', + ], + [ + 'group' => 'd3_gtm_settings_serversidetagging', + 'name' => 'd3_gtm_settings_serversidetagging_nojs', + 'type' => 'str', + 'value' => 'https://www.googletagmanager.com/ns.html', + ], ] ]; \ No newline at end of file