8
0

[OST#929760][Added] serverside tagging usability

*missing any test, yet!
Dieser Commit ist enthalten in:
MaxBUhe 2024-03-19 09:22:07 +01:00
Ursprung 9410495a58
Commit bc8876367c
4 geänderte Dateien mit 41 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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()}]');
</script>

Datei anzeigen

@ -2,7 +2,7 @@
[{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=[{$oViewConf->getGtmContainerId()}]"
<iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->

Datei anzeigen

@ -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');
}
}

Datei anzeigen

@ -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',
],
]
];