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 fd3468d..0d65126 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -215,4 +215,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 fb8c1c7..a56cb60 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