diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/Application/views/admin/de/module_options.php b/Application/views/admin/de/module_options.php index 35694eb..a7b1a56 100755 --- a/Application/views/admin/de/module_options.php +++ b/Application/views/admin/de/module_options.php @@ -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 "Steuerungsparameter"
+ Beachte:
+ Sofern Sie die consentmanager CMP verwenden, + bitte ich Sie, gründlichst, die Hinweise der Moduldokumentation/Consentmanager zu lesen. + ' ]; diff --git a/CHANGELOG.md b/CHANGELOG.md index d0dac6f..d520ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -116,6 +116,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20 ### Added - using of ContainerFactory in ViewConfig +## [1.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.12.0...1.13.0) - 2023-09-13 +### Added +- extended Docs +### Changed +- control-param name +- control-param function +- adjusted check for set control-param +- consentmanager-script-adjustments + +## [1.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.1...1.12.0) - 2023-09-07 +### Added +- cookiebot functionality + +## [1.11.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.0...1.11.1) - 2023-08-17 +### Fixed +- metadata class entry + +## [1.11.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.10.0...1.11.0) - 2023-08-16 +### Added +- remove_from_cart +- auto debug_mode setter +- manufacturer extension for breadcrumb +### Changed +- general template cleanup ## [1.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.9.0...1.10.0) - 2023-06-27 ### Added diff --git a/Docs/CMP/consentmanager.md b/Docs/CMP/consentmanager.md new file mode 100644 index 0000000..264536b --- /dev/null +++ b/Docs/CMP/consentmanager.md @@ -0,0 +1,18 @@ +# Consentmanager +## 1. Steuerungsparameter +Tragen Sie hier die gewünschte ID des zu prüfenden Anbieters (Vendor-ID) ein.
+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) \ No newline at end of file diff --git a/Docs/README.md b/Docs/README.md index 865d3ba..8df6e03 100644 --- a/Docs/README.md +++ b/Docs/README.md @@ -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 @@ -23,6 +30,10 @@ Für den geregelten Ablauf sind folgende Blöcke nötig: - Blockname: details_productmain_tobasket - Datei: page/details/inc/productmain.tpl - GA4 Event: add_to_cart +- aus dem WK entfernen + - Blockname: checkout_basket_main + - Datei: page/checkout/basket.tpl + - GA4 Event: remove_from_cart - Warenkorb - Blockname: checkout_basket_main - Datei: page/checkout/basket.tpl @@ -50,6 +61,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 @@ -74,6 +88,6 @@ Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo - prüfen, ob ein Cookie vorgegeben ist - sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter ```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen - + - [Cookiebot](https://www.cookiebot.com) - Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite. \ No newline at end of file diff --git a/IntelliSenseHelper.php b/IntelliSenseHelper.php index f8ac44a..08ac114 100644 --- a/IntelliSenseHelper.php +++ b/IntelliSenseHelper.php @@ -24,4 +24,5 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model{ namespace D3\GoogleAnalytics4\Modules\Application\Controller{ class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {} + class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {} } \ No newline at end of file diff --git a/Modules/Application/Controller/ThankYouController.php b/Modules/Application/Controller/ThankYouController.php new file mode 100644 index 0000000..215503a --- /dev/null +++ b/Modules/Application/Controller/ThankYouController.php @@ -0,0 +1,22 @@ +getOrder()->getFieldData('oxbillcountryid'); + + /** @var Country $oCountry */ + $oCountry = oxNew(Country::class); + $oCountry->load($sCountryId); + + return $oCountry; + } +} \ No newline at end of file diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 1a8baa6..5a0ae57 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -82,7 +82,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) { @@ -123,9 +123,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 ""; } @@ -134,29 +134,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 ""; @@ -164,6 +155,7 @@ class ViewConfig extends ViewConfig_parent private $blGA4enabled = null; + public function isGA4enabled() { if ($this->blGA4enabled === null) diff --git a/metadata.php b/metadata.php index bea66b4..133a3f1 100755 --- a/metadata.php +++ b/metadata.php @@ -1,11 +1,12 @@ [ OEViewConfig::class => ViewConfig::class, OECategory::class => Category::class, - OEManufacturer::class => Manufacturer::class, OEBasket::class => Basket::class, - OEBasketController::class => BasketController::class + OEBasketController::class => BasketController::class, + OEManufacturer::class => Manufacturer::class, + OEThankYouController::class => ThankYouController::class ], 'templates' => [], 'blocks' => [ @@ -131,9 +133,9 @@ $aModule = [ ], [ 'group' => 'd3_gtm_settings_cookiemanager', - 'name' => 'd3_gtm_settings_cookieName', + 'name' => 'd3_gtm_settings_controlParameter', 'type' => 'str', - 'value' => 'example', + 'value' => '', 'position' => 999 ], [