Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts: # Application/views/admin/de/module_options.php # Application/views/ga4/view_item_list.tpl # CHANGELOG.md # Docs/README.md # IntelliSenseHelper.php # Modules/Core/ViewConfig.php # metadata.php
This commit is contained in:
commit
f02c40cfb7
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.idea
|
@ -44,5 +44,10 @@ $aLang = [
|
|||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
|
'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_COOKIEFIRST' => 'cookiefirst',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
|
'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.
|
||||||
|
'
|
||||||
];
|
];
|
||||||
|
24
CHANGELOG.md
24
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
|
## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20
|
||||||
### Added
|
### Added
|
||||||
- using of ContainerFactory in ViewConfig
|
- 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
|
## [1.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.9.0...1.10.0) - 2023-06-27
|
||||||
### Added
|
### Added
|
||||||
|
18
Docs/CMP/consentmanager.md
Normal file
18
Docs/CMP/consentmanager.md
Normal 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)
|
@ -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?
|
*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/
|
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
|
## Blöcke
|
||||||
Für den geregelten Ablauf sind folgende Blöcke nötig:
|
Für den geregelten Ablauf sind folgende Blöcke nötig:
|
||||||
- Suchergebnisse
|
- Suchergebnisse
|
||||||
@ -23,6 +30,10 @@ Für den geregelten Ablauf sind folgende Blöcke nötig:
|
|||||||
- Blockname: details_productmain_tobasket
|
- Blockname: details_productmain_tobasket
|
||||||
- Datei: page/details/inc/productmain.tpl
|
- Datei: page/details/inc/productmain.tpl
|
||||||
- GA4 Event: add_to_cart
|
- GA4 Event: add_to_cart
|
||||||
|
- aus dem WK entfernen
|
||||||
|
- Blockname: checkout_basket_main
|
||||||
|
- Datei: page/checkout/basket.tpl
|
||||||
|
- GA4 Event: remove_from_cart
|
||||||
- Warenkorb
|
- Warenkorb
|
||||||
- Blockname: checkout_basket_main
|
- Blockname: checkout_basket_main
|
||||||
- Datei: page/checkout/basket.tpl
|
- 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.
|
die Cookie-ID des zugehörigen Cookies ein.
|
||||||
Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Cookie Manager nutzen?".
|
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
|
### Unterstützung für
|
||||||
- [aggrosoft - oxid-cookie-compliance](https://github.com/aggrosoft/oxid-cookie-compliance)
|
- [aggrosoft - oxid-cookie-compliance](https://github.com/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
|
- prüfen, ob ein Cookie vorgegeben ist
|
||||||
- sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter
|
- sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter
|
||||||
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||||
|
|
||||||
- [Cookiebot](https://www.cookiebot.com)
|
- [Cookiebot](https://www.cookiebot.com)
|
||||||
- Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite.
|
- Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite.
|
@ -24,4 +24,5 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
|||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
||||||
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {}
|
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {}
|
||||||
|
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
|
||||||
}
|
}
|
22
Modules/Application/Controller/ThankYouController.php
Normal file
22
Modules/Application/Controller/ThankYouController.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Model\Country;
|
||||||
|
|
||||||
|
class ThankYouController extends ThankYouController_parent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return Country
|
||||||
|
*/
|
||||||
|
public function d3GAGetUserCountry()
|
||||||
|
{
|
||||||
|
$sCountryId = $this->getOrder()->getFieldData('oxbillcountryid');
|
||||||
|
|
||||||
|
/** @var Country $oCountry */
|
||||||
|
$oCountry = oxNew(Country::class);
|
||||||
|
$oCountry->load($sCountryId);
|
||||||
|
|
||||||
|
return $oCountry;
|
||||||
|
}
|
||||||
|
}
|
@ -82,7 +82,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
|
|
||||||
$this->defineCookieManagerType();
|
$this->defineCookieManagerType();
|
||||||
|
|
||||||
$sCookieID = trim($oConfig->getConfigParam('d3_gtm_settings_cookieName'));
|
$sCookieID = trim($oConfig->getConfigParam('d3_gtm_settings_controlParameter'));
|
||||||
|
|
||||||
// Netensio Cookie Manager
|
// Netensio Cookie Manager
|
||||||
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
||||||
@ -123,9 +123,9 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
*/
|
*/
|
||||||
public function getGtmScriptAttributes() :string
|
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 "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,29 +134,20 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ($sCookieId) {
|
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
|
||||||
return 'data-usercentrics="' . $sCookieId . '" type="text/plain" async=""';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
||||||
{
|
{
|
||||||
if ($sCookieId) {
|
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
|
||||||
return 'async
|
|
||||||
type="text/plain"
|
|
||||||
data-cmp-src="https://www.googletagmanager.com/gtm.js?id='.$this->getGtmContainerId().'"
|
|
||||||
class="cmplazyload"
|
|
||||||
data-cmp-vendor="s905"
|
|
||||||
';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEFIRST){
|
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){
|
if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
|
||||||
return 'type="text/plain" data-cookieconsent="' . $sCookieId .'"';
|
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
@ -164,6 +155,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
|
|
||||||
private $blGA4enabled = null;
|
private $blGA4enabled = null;
|
||||||
|
|
||||||
|
|
||||||
public function isGA4enabled()
|
public function isGA4enabled()
|
||||||
{
|
{
|
||||||
if ($this->blGA4enabled === null)
|
if ($this->blGA4enabled === null)
|
||||||
|
12
metadata.php
12
metadata.php
@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController;
|
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
|
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
|
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
|
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
|
||||||
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
||||||
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
|
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouController;
|
||||||
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
|
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
|
||||||
use OxidEsales\Eshop\Application\Model\Category as OECategory;
|
use OxidEsales\Eshop\Application\Model\Category as OECategory;
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
|
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
|
||||||
@ -33,9 +34,10 @@ $aModule = [
|
|||||||
'extend' => [
|
'extend' => [
|
||||||
OEViewConfig::class => ViewConfig::class,
|
OEViewConfig::class => ViewConfig::class,
|
||||||
OECategory::class => Category::class,
|
OECategory::class => Category::class,
|
||||||
OEManufacturer::class => Manufacturer::class,
|
|
||||||
OEBasket::class => Basket::class,
|
OEBasket::class => Basket::class,
|
||||||
OEBasketController::class => BasketController::class
|
OEBasketController::class => BasketController::class,
|
||||||
|
OEManufacturer::class => Manufacturer::class,
|
||||||
|
OEThankYouController::class => ThankYouController::class
|
||||||
],
|
],
|
||||||
'templates' => [],
|
'templates' => [],
|
||||||
'blocks' => [
|
'blocks' => [
|
||||||
@ -131,9 +133,9 @@ $aModule = [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'd3_gtm_settings_cookiemanager',
|
'group' => 'd3_gtm_settings_cookiemanager',
|
||||||
'name' => 'd3_gtm_settings_cookieName',
|
'name' => 'd3_gtm_settings_controlParameter',
|
||||||
'type' => 'str',
|
'type' => 'str',
|
||||||
'value' => 'example',
|
'value' => '',
|
||||||
'position' => 999
|
'position' => 999
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user