Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
3f59d1f210 | |||
5ed924e840 | |||
d4ef0f35f9 | |||
c17ae1cef5 | |||
32e08a88ca | |||
9d9daf9a85 | |||
6eefc062ba | |||
3f89e26bde | |||
e624cfdfcb | |||
e2cdda530b | |||
3e65d05c0b | |||
561a2101f1 | |||
6fca52cc06 | |||
dfdc5d5edf | |||
ae6f9bfaa9 | |||
1d9e09b8b1 | |||
f9a0834d26 | |||
bb70cda626 | |||
c9a1174c98 | |||
f3b2911679 |
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Application\Model;
|
|
||||||
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
use OxidEsales\Eshop\Core\ViewConfig;
|
|
||||||
|
|
||||||
class ManagerHandler
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getCurrManager() :string
|
|
||||||
{
|
|
||||||
/** @var ManagerTypes $oManagerTypes */
|
|
||||||
$oManagerTypes = oxNew(ManagerTypes::class);
|
|
||||||
|
|
||||||
/** @var ViewConfig $oViewConfig */
|
|
||||||
$oViewConfig = oxNew(ViewConfig::class);
|
|
||||||
|
|
||||||
$aManagerList = $oManagerTypes->getManagerList();
|
|
||||||
|
|
||||||
foreach ($aManagerList as $managerName){
|
|
||||||
if ($oViewConfig->isModuleActive($managerName)){
|
|
||||||
return $managerName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->getExplicitManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getModuleSettingExplicitManagerSelectValue() :string
|
|
||||||
{
|
|
||||||
return Registry::getConfig()->getConfigParam('d3_gtm_settings_HAS_STD_MANAGER');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getExplicitManager() :string
|
|
||||||
{
|
|
||||||
$sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue();
|
|
||||||
|
|
||||||
/** @var ManagerTypes $oManagerTypes */
|
|
||||||
$oManagerTypes = oxNew(ManagerTypes::class);
|
|
||||||
return $oManagerTypes->isManagerInList($sPotentialManagerName)
|
|
||||||
? $sPotentialManagerName
|
|
||||||
: "NONE";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Application\Model;
|
|
||||||
|
|
||||||
class ManagerTypes
|
|
||||||
{
|
|
||||||
#ToDo: make own classes for each of the manager
|
|
||||||
|
|
||||||
|
|
||||||
const EXTERNAL_SERVICE = "externalService";
|
|
||||||
const NET_COOKIE_MANAGER = "net_cookie_manager";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Further information's:
|
|
||||||
* https://github.com/aggrosoft/oxid-cookie-compliance
|
|
||||||
*/
|
|
||||||
const AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used the OXID Module.
|
|
||||||
*
|
|
||||||
* Further information's:
|
|
||||||
* https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html
|
|
||||||
*
|
|
||||||
* Usercentrics homepage:
|
|
||||||
* https://usercentrics.com
|
|
||||||
*/
|
|
||||||
const USERCENTRICS_MODULE = "oxps_usercentrics";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* manually included usercentrics script
|
|
||||||
*/
|
|
||||||
const USERCENTRICS_MANUALLY = "USERCENTRICS";
|
|
||||||
|
|
||||||
const CONSENTMANAGER = "CONSENTMANAGER";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getManagerList(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
"externalService" => self::EXTERNAL_SERVICE,
|
|
||||||
"agcookiecompliance" => self::AGCOOKIECOMPLIANCE,
|
|
||||||
"net_cookie_manager" => self::NET_COOKIE_MANAGER,
|
|
||||||
"oxps_usercentrics" => self::USERCENTRICS_MODULE,
|
|
||||||
"usercentrics" => self::USERCENTRICS_MANUALLY,
|
|
||||||
"consentmanager" => self::CONSENTMANAGER
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sManager
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isManagerInList(string $sManager) :bool
|
|
||||||
{
|
|
||||||
return in_array($sManager, $this->getManagerList(), true);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +1,36 @@
|
|||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
||||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||||
|
|
||||||
[{assign var="breadCrumb" value=''}]
|
[{assign var="breadCrumb" value=''}]
|
||||||
|
|
||||||
[{if $gtmProducts|@count}]
|
[{if $gtmProducts|@count}]
|
||||||
[{strip}]
|
[{strip}]
|
||||||
<script>
|
<script>
|
||||||
/* ga4 */
|
/* ga4 */
|
||||||
dataLayer.push({ecommerce: null});
|
dataLayer.push({ecommerce: null});
|
||||||
dataLayer.push({
|
dataLayer.push({
|
||||||
'event':'view_item_list',
|
'event':'view_item_list',
|
||||||
'event_name': 'view_item_list',
|
'event_name': 'view_item_list',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'item_list_id': '[{$oView->getCategoryId()}]',
|
'item_list_id': '[{$oView->getCategoryId()}]',
|
||||||
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
||||||
'items': [
|
'items': [
|
||||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||||
{
|
{
|
||||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
'price': [{$d3PriceObject->getPrice()}],
|
'price': [{$d3PriceObject->getPrice()}],
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||||
'quantity': 1
|
'quantity': 1
|
||||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||||
[{/foreach}]
|
[{/foreach}]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
[{/strip}]
|
[{/strip}]
|
||||||
[{/if}]
|
[{/if}]
|
66
CHANGELOG.md
66
CHANGELOG.md
@ -4,74 +4,10 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [2.7.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.6.0...2.7.0) - 2023-06-19
|
## [1.9.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.8.0...1.9.0) - 2023-06-19
|
||||||
### Changed
|
### Changed
|
||||||
- add_to_cart event template-structure
|
- add_to_cart event template-structure
|
||||||
|
|
||||||
## [2.6.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.5.0...2.6.0) - 2023-05-31
|
|
||||||
### Added
|
|
||||||
- add settings to explicit choose an external service (usercentrics/ consentmanager)
|
|
||||||
- position to block-extension
|
|
||||||
- extended instructions to check for in readme
|
|
||||||
### Fixed
|
|
||||||
- usercentrics script
|
|
||||||
- missing right articleList-getter
|
|
||||||
### Changed
|
|
||||||
- view_item_list-template block extension
|
|
||||||
- cookieManager handling
|
|
||||||
### Removed
|
|
||||||
- additional check for cookieManagerType
|
|
||||||
|
|
||||||
## [2.5.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.4.0...2.5.0) - 2023-05-23
|
|
||||||
### Added
|
|
||||||
- additional settings to explicitly indicate that consentmanager is used
|
|
||||||
### Fixed
|
|
||||||
- unnecessary converting of int to str
|
|
||||||
- missing PriceObject-bug
|
|
||||||
### Changed
|
|
||||||
- genuine code cleanup
|
|
||||||
|
|
||||||
## [2.4.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.3.3...2.4.0) - 2023-05-02
|
|
||||||
### Added
|
|
||||||
- "OXID Cookie Management powered by usercentrics" compatibility
|
|
||||||
- usercentrics defined script attributes
|
|
||||||
- cookie-manager evaluation
|
|
||||||
### Changed
|
|
||||||
- genuine clean up of base-js-files
|
|
||||||
|
|
||||||
## [2.3.3](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.3.2...2.3.3) - 2023-03-20
|
|
||||||
### Fixed
|
|
||||||
- metadata file path for view_item
|
|
||||||
|
|
||||||
## [2.3.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.2.2...2.3.2) - 2023-03-17
|
|
||||||
### Added
|
|
||||||
- Aggrosoft-Cookie-Consent compatibility
|
|
||||||
### Fixed
|
|
||||||
- wrong function for pageview on thankyou page
|
|
||||||
### Deleted
|
|
||||||
- unused files
|
|
||||||
|
|
||||||
## [2.2.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.2.1...2.2.2) - 2023-02-22
|
|
||||||
### Fixed
|
|
||||||
- price formatting in view_cart
|
|
||||||
|
|
||||||
## [2.2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1.1...2.2.1) - 2023-02-21
|
|
||||||
### Added
|
|
||||||
- cookie handling
|
|
||||||
|
|
||||||
## [2.1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1...2.1.1) - 2023-01-27
|
|
||||||
### Fixed
|
|
||||||
- add missing class import
|
|
||||||
|
|
||||||
## [2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.0...2.1) - 2023-01-27
|
|
||||||
### Added
|
|
||||||
- block section for add_to_basket js
|
|
||||||
- template block order positions
|
|
||||||
|
|
||||||
## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20
|
|
||||||
### Added
|
|
||||||
- using of ContainerFactory in ViewConfig
|
|
||||||
|
|
||||||
## [1.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.7.0...1.8.0) - 2023-05-31
|
## [1.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.7.0...1.8.0) - 2023-05-31
|
||||||
### Fixed
|
### Fixed
|
||||||
- bug in explicit manager selection
|
- bug in explicit manager selection
|
||||||
|
@ -12,7 +12,7 @@ Für den geregelten Ablauf sind folgende Blöcke nötig:
|
|||||||
- Datei: page/search/search.tpl
|
- Datei: page/search/search.tpl
|
||||||
- GA4 Event: view_search_results
|
- GA4 Event: view_search_results
|
||||||
- Artikelliste
|
- Artikelliste
|
||||||
- Blockname: page_list_productlist (muss hinzugefügt werden)
|
- Blockname: page_list_productlist
|
||||||
- Datei: page/list/list.tpl
|
- Datei: page/list/list.tpl
|
||||||
- GA4 Event: view_item_list
|
- GA4 Event: view_item_list
|
||||||
- Detailseite
|
- Detailseite
|
||||||
@ -65,12 +65,4 @@ Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
|||||||
- [OXID Cookie Management powered by usercentrics](https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html)
|
- [OXID Cookie Management powered by usercentrics](https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html)
|
||||||
- In der Usercentrics-Verwaltung die Services "Google Analytics" und "Google Tag Manager" anlegen
|
- In der Usercentrics-Verwaltung die Services "Google Analytics" und "Google Tag Manager" anlegen
|
||||||
- Den Service ```Google Tag Manager``` in den Moduleinstellungen des 'Google Analytics 4' unter
|
- Den Service ```Google Tag Manager``` in den Moduleinstellungen des 'Google Analytics 4' unter
|
||||||
Google Tag Manager eintragen
|
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||||
-
|
|
||||||
- [Consent Management Provider](https://www.consentmanager.net/)
|
|
||||||
- In der Consentmanager-Oberfläche den Anbieter "Google Tag Manager" mit der ID s905 hinzufügen
|
|
||||||
- Im Frontend, im consentmanager-Pop-up nach dem 'Google Tag Manager' suchen
|
|
||||||
- kleines Fragezeichen neben den Namen anklicken und ganz runter scrollen
|
|
||||||
- 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
|
|
@ -12,13 +12,9 @@
|
|||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Core;
|
namespace D3\GoogleAnalytics4\Modules\Core;
|
||||||
|
|
||||||
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
|
||||||
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
|
||||||
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||||
use OxidEsales\Eshop\Core\Config;
|
use OxidEsales\Eshop\Core\Config;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
|
|
||||||
|
|
||||||
class ViewConfig extends ViewConfig_parent
|
class ViewConfig extends ViewConfig_parent
|
||||||
{
|
{
|
||||||
@ -31,31 +27,59 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
{
|
{
|
||||||
if ($this->sContainerId === null)
|
if ($this->sContainerId === null)
|
||||||
{
|
{
|
||||||
$this->sContainerId = ContainerFactory::getInstance()
|
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID');
|
||||||
->getContainer()
|
|
||||||
->get(ModuleSettingBridgeInterface::class)
|
|
||||||
->get('d3_gtm_sContainerID', 'd3googleanalytics4');
|
|
||||||
}
|
}
|
||||||
return $this->sContainerId;
|
return $this->sContainerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function defineCookieManagerType() :void
|
public function getModuleSettingExplicitManagerSelectValue()
|
||||||
|
{
|
||||||
|
return Registry::getConfig()->getConfigParam('d3_gtm_settings_HAS_STD_MANAGER');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return false|mixed
|
||||||
|
*/
|
||||||
|
public function getExplicitManager()
|
||||||
|
{
|
||||||
|
$sManagerName = $this->getModuleSettingExplicitManagerSelectValue();
|
||||||
|
return $sManagerName === "NONE" ? false : $sManagerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCookieManagerType()
|
||||||
{
|
{
|
||||||
if ($this->sCookieManagerType === null)
|
if ($this->sCookieManagerType === null)
|
||||||
{
|
{
|
||||||
/** @var ManagerHandler $oManagerHandler */
|
$this->sCookieManagerType = false;
|
||||||
$oManagerHandler = oxNew(ManagerHandler::class);
|
|
||||||
$this->sCookieManagerType = $oManagerHandler->getCurrManager();
|
$allowedManagerTypes = [
|
||||||
|
'net_cookie_manager',
|
||||||
|
'agcookiecompliance',
|
||||||
|
'oxps_usercentrics'
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($allowedManagerTypes as $type) {
|
||||||
|
if ($this->isModuleActive($type)) {
|
||||||
|
$this->sCookieManagerType = $type;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->sCookieManagerType === false and $this->getExplicitManager()){
|
||||||
|
return "externalService";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->sCookieManagerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function shallUseOwnCookieManager() :bool
|
public function shallUseOwnCookieManager()
|
||||||
{
|
{
|
||||||
return (bool) Registry::getConfig()->getConfigParam('d3_gtm_settings_hasOwnCookieManager');
|
return (bool) Registry::getConfig()->getConfigParam('d3_gtm_settings_hasOwnCookieManager');
|
||||||
}
|
}
|
||||||
@ -69,42 +93,33 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
$oConfig = Registry::getConfig();
|
$oConfig = Registry::getConfig();
|
||||||
|
|
||||||
// No Cookie Manager in use
|
// No Cookie Manager in use
|
||||||
if (!$this->shallUseOwnCookieManager()) {
|
if (false === $this->shallUseOwnCookieManager()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->defineCookieManagerType();
|
|
||||||
|
|
||||||
$sCookieID = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
$sCookieID = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||||
|
|
||||||
// Netensio Cookie Manager
|
// Netensio Cookie Manager
|
||||||
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
if ($this->getCookieManagerType() == "net_cookie_manager") {
|
||||||
$oSession = Registry::getSession();
|
$oSession = Registry::getSession();
|
||||||
$aCookies = $oSession->getVariable("aCookieSel");
|
$aCookies = $oSession->getVariable("aCookieSel");
|
||||||
|
|
||||||
return (is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1");
|
return (!is_null($aCookies) && is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Aggrosoft Cookie Consent
|
// Aggrosoft Cookie Consent
|
||||||
if ($this->sCookieManagerType === ManagerTypes::AGCOOKIECOMPLIANCE) {
|
if ($this->getCookieManagerType() == "agcookiecompliance") {
|
||||||
if (method_exists($this, "isCookieCategoryEnabled")) {
|
if (method_exists($this, "isCookieCategoryEnabled")) {
|
||||||
return $this->isCookieCategoryEnabled($sCookieID);
|
return $this->isCookieCategoryEnabled($sCookieID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserCentrics or consentmanager
|
// UserCentrics or consentmanager
|
||||||
if (
|
if ($this->getCookieManagerType() === "oxps_usercentrics" or $this->getCookieManagerType() === 'externalService') {
|
||||||
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
|
||||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
|
||||||
or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
|
|
||||||
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Always needs the script-tags delivered to the DOM.
|
// Always needs the script-tags delivered to the DOM.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cookie Manager not (yet) supported
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,27 +128,25 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
* This is especially important for UserCentrics.
|
* This is especially important for UserCentrics.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getGtmScriptAttributes() :string
|
public function getGtmScriptAttributes()
|
||||||
{
|
{
|
||||||
$oConfig = Registry::getConfig();
|
$oConfig = Registry::getConfig();
|
||||||
$sCookieId = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
|
||||||
|
|
||||||
if (false === $this->shallUseOwnCookieManager()){
|
if (false === $this->shallUseOwnCookieManager()){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if ($this->getCookieManagerType() === "oxps_usercentrics" or $this->getExplicitManager() === 'USERCENTRICS') {
|
||||||
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
$sCookieId = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if ($sCookieId) {
|
if ($sCookieId) {
|
||||||
return 'data-usercentrics="' . $sCookieId . '" type="text/plain" async=""';
|
return 'data-usercentrics="' . $sCookieId . '" type="text/plain" async=""';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
if ($this->getCookieManagerType() === "externalService" and $this->getExplicitManager() === 'CONSENTMANAGER') {
|
||||||
{
|
$sCookieId = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||||
|
|
||||||
if ($sCookieId) {
|
if ($sCookieId) {
|
||||||
return 'async
|
return 'async
|
||||||
type="text/plain"
|
type="text/plain"
|
||||||
@ -153,10 +166,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
{
|
{
|
||||||
if ($this->blGA4enabled === null)
|
if ($this->blGA4enabled === null)
|
||||||
{
|
{
|
||||||
$this->sContainerId = ContainerFactory::getInstance()
|
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4');
|
||||||
->getContainer()
|
|
||||||
->get(ModuleSettingBridgeInterface::class)
|
|
||||||
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->blGA4enabled;
|
return $this->blGA4enabled;
|
||||||
|
@ -23,16 +23,16 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
|
|||||||
Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
|
Öffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). Führen Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php composer require d3/google-analytics4:^2
|
php composer require d3/google-analytics4:^1
|
||||||
```
|
```
|
||||||
|
|
||||||
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
||||||
|
|
||||||
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
||||||
|
|
||||||
### Wichtig!
|
> ### Wichtig!
|
||||||
Bitte stellen Sie sicher, dass die nötigen Template-Blöcke im OXID-Shop zur Verfügung stehen.
|
> Bitte stellen Sie sicher, dass die nötigen Blöcke im OXID-Shop zur Verfügung stehen.
|
||||||
Lesen Sie mehr in der [technischen Doku](./Docs/README.md) unter "Blöcke"!
|
> Lesen Sie mehr in der [technischen Doku](./Docs/README.md) unter "Blöcke"!
|
||||||
|
|
||||||
## Verwendung
|
## Verwendung
|
||||||
### Grundfunktionalität
|
### Grundfunktionalität
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.1",
|
||||||
"oxid-esales/oxideshop-ce": "^6.5",
|
"oxid-esales/oxideshop-ce": "v6.0 - 6.3",
|
||||||
"google/apiclient":" ^2.0"
|
"google/apiclient":" ^2.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -17,7 +17,7 @@ $aModule = [
|
|||||||
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
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',
|
'thumbnail' => 'thumbnail.png',
|
||||||
'version' => '2.7.0',
|
'version' => '1.9.0',
|
||||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
|
Reference in New Issue
Block a user