Compare commits

...

5 Commits

6 changed files with 59 additions and 20 deletions

View File

@ -44,5 +44,10 @@ $aLang = [
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'CookieID',
'SHOP_MODULE_d3_gtm_settings_controlParameter' => 'Steuerungsparameter',
'HELP_SHOP_MODULE_d3_gtm_settings_controlParameter' => 'Nähere infos zum <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs">"<strong>Steuerungsparameter</strong>"</a><hr>
<strong>Beachte:</strong><br>
Sofern Sie die <a target="_blank" href="https://consentmanager.net" style="color: blue">consentmanager</a> CMP verwenden,
bitte ich Sie, gründlichst, die Hinweise der <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md">Moduldokumentation/Consentmanager</a> zu lesen.
'
];

View File

@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.12.0...2.13.0) - 2023-09-13
### Added
- extended Docs
### Changed
- control-param name
- control-param function
- adjusted check for set control-param
- consentmanager-script-adjustments
## [2.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.11.1...2.12.0) - 2023-09-07
### Added
- cookiebot functionality

View File

@ -0,0 +1,18 @@
# Consentmanager
## 1. Steuerungsparameter
Tragen Sie hier die gewünschte ID des zu prüfenden Anbieters (Vendor-ID) ein.<br>
Diese ID finden Sie in Ihrem Consentmanager-Dashboard, links, unter "CMP > Anbieter".
Nähere Informationen hierzu suchen Sie bitte auf der offiziellen Webseite von [app.consentmanager](https://help.consentmanager.de/books/cmp/page/4-configuring-vendors-and-cookies).
## 2. Gebräuchliche ID's
- s26 (Google Analytics/ GA/ GA4)
- s905 (Google Tag Manager/ GTM)
## 3. Einrichtung GTM
Die von Ihnen eingetragene ID muss oder ist schlussendlich die ID, auf die im GTM-Umfeld geprüft wird.
Das heißt, dass sich die Eintragung nach GTM, oder umgekehrt, richtet.
### Unterstützung benötigt?
Kein Problem!
Kontaktieren Sie uns gern unter [d3data.de](https://www.d3data.de)

View File

@ -5,6 +5,13 @@ Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/mo
*Hinweis: nicht alle templates sind bereits gefüllt. Wünschen Sie die Implementierung eines unausgefüllten templates?
Kommen Sie auf uns zu unter https://www.d3data.de/
## Steuerungsparameter
Tragen Sie hier im Normalfall die ID des zu prüfenden Cookies ein.
In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt
nach der gewählten CMP (Consent Manager Platform).
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
## Blöcke
Für den geregelten Ablauf sind folgende Blöcke nötig:
- Suchergebnisse
@ -50,6 +57,9 @@ Dann tragen Sie in den Folgeeinstellungen unter "Cookie Manager Einstellungen",
die Cookie-ID des zugehörigen Cookies ein.
Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Cookie Manager nutzen?".
## Consent Manager Platform (CMP)
- [Consentmanager](https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md)
### Unterstützung für
- [aggrosoft - oxid-cookie-compliance](https://github.com/aggrosoft/oxid-cookie-compliance)
- https://github.com/aggrosoft/oxid-cookie-compliance

View File

@ -19,6 +19,8 @@ use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class ViewConfig extends ViewConfig_parent
{
@ -75,7 +77,7 @@ class ViewConfig extends ViewConfig_parent
$this->defineCookieManagerType();
$sCookieID = trim($oConfig->getConfigParam('d3_gtm_settings_cookieName'));
$sCookieID = trim($oConfig->getConfigParam('d3_gtm_settings_controlParameter'));
// Netensio Cookie Manager
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
@ -117,9 +119,9 @@ class ViewConfig extends ViewConfig_parent
*/
public function getGtmScriptAttributes() :string
{
$sCookieId = trim(Registry::getConfig()->getConfigParam('d3_gtm_settings_cookieName'));
$sControlParameter = trim(Registry::getConfig()->getConfigParam('d3_gtm_settings_controlParameter'));
if (false === $this->shallUseOwnCookieManager()){
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')){
return "";
}
@ -128,29 +130,20 @@ class ViewConfig extends ViewConfig_parent
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
)
{
if ($sCookieId) {
return 'data-usercentrics="' . $sCookieId . '" type="text/plain" async=""';
}
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
}
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
{
if ($sCookieId) {
return 'async
type="text/plain"
data-cmp-src="https://www.googletagmanager.com/gtm.js?id='.$this->getGtmContainerId().'"
class="cmplazyload"
data-cmp-vendor="s905"
';
}
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
}
if ($this->sCookieManagerType === ManagerTypes::COOKIEFIRST){
return 'type="text/plain" data-cookiefirst-category="' . $sCookieId .'"';
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
}
if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
return 'type="text/plain" data-cookieconsent="' . $sCookieId .'"';
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
}
return "";
@ -158,6 +151,10 @@ class ViewConfig extends ViewConfig_parent
private $blGA4enabled = null;
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function isGA4enabled()
{
if ($this->blGA4enabled === null)

View File

@ -26,7 +26,7 @@ $aModule = [
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
",
'thumbnail' => 'thumbnail.png',
'version' => '2.12.0',
'version' => '2.13.0',
'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
@ -131,9 +131,9 @@ $aModule = [
],
[
'group' => 'd3_gtm_settings_cookiemanager',
'name' => 'd3_gtm_settings_cookieName',
'name' => 'd3_gtm_settings_controlParameter',
'type' => 'str',
'value' => 'example',
'value' => '',
'position' => 999
],
[