Compare commits
224 Commits
Author | SHA1 | Date | |
---|---|---|---|
2ea16f2b62 | |||
b2a302fbb3 | |||
e347739bd3 | |||
3250f2bf91 | |||
14adccc4d5 | |||
9d4f51e574 | |||
31f7578aa4 | |||
05fbafea6e | |||
c0951277b8 | |||
28f04c8281 | |||
f7bef420aa | |||
c0c78ce63d | |||
2ec373c95f | |||
6fcb9f8b84 | |||
53b3c878ce | |||
65b618e25c | |||
4b2c978035 | |||
2a27b25c5a | |||
a8ca33b10d | |||
31bafa621b | |||
48e2dc58ad | |||
f27040e7dd | |||
79994eae69 | |||
6bdf788ebf | |||
98ddc51a4d | |||
9edf3b9265 | |||
48a598da51 | |||
bc1dafbbfa | |||
2a1f8f5794 | |||
7bc73893c3 | |||
2f7b07ab95 | |||
84240f96a9 | |||
542471b053 | |||
7873714f17 | |||
6dff6860bf | |||
81c7051f7b | |||
29831fa157 | |||
cf143c4881 | |||
16387c59bb | |||
cc2e9a5fc6 | |||
97dad5c8eb | |||
b7167ec60a | |||
592ea4284c | |||
1dc65ad24a | |||
efac71905e | |||
10386ccbf5 | |||
62ef191d47 | |||
cea8cc9163 | |||
4b69a583c2 | |||
9a5e1506e8 | |||
e500814e7e | |||
0dc5565640 | |||
1dd353ce58 | |||
bbd7b5ec95 | |||
1356f2f0e7 | |||
fca1231032 | |||
c4652df373 | |||
c7ee79f271 | |||
8c5e110265 | |||
ed7a93b8ae | |||
e7d921f20e | |||
049454a782 | |||
8e52b0541a | |||
cb9cd11ff5 | |||
ef29f7eb1b | |||
4a4b328364 | |||
09ccb6726d | |||
54d6918fcf | |||
7ab62493e4 | |||
91e0c5c0c9 | |||
96f6321b14 | |||
a184627443 | |||
681d0932e0 | |||
efc9aa08e0 | |||
db39d4155f | |||
17839b319e | |||
7847ad9874 | |||
b3f2446a7d | |||
ce1614996a | |||
ec2d43ff3c | |||
c32c66322f | |||
8079eee236 | |||
00c0bd2497 | |||
76eeb0d5bd | |||
0baa44e5d7 | |||
a38dcb8e45 | |||
1ae5a9d926 | |||
938d1514a6 | |||
9a48d32c3b | |||
bc8876367c | |||
9410495a58 | |||
05df5ef100 | |||
59ef1d0625 | |||
e4969f2cbd | |||
13ef2bef7b | |||
59f0e37cce | |||
bcf38a6e11 | |||
31b3474cfd | |||
1a641de8fc | |||
268cf6f6da | |||
5d5b3459cd | |||
1c1080923b | |||
007e83909b | |||
ed5fcc6011 | |||
22ea5a1ce2 | |||
229cf3695f | |||
a990834da4 | |||
6047f72edf | |||
e2564f613a | |||
9ea5408e44 | |||
ab6b7f7454 | |||
a88fa570a8 | |||
81aab10c4e | |||
5ac3385b53 | |||
19553fcee2 | |||
bb513e6ded | |||
36b3aa9ef2 | |||
ef4e4625cd | |||
84a9aba764 | |||
7d12dd68a7 | |||
565f47b1ff | |||
7c6b0215a5 | |||
84e3895db8 | |||
1e479503a7 | |||
9e7b4653ea | |||
7b1241ab97 | |||
0f15df8364 | |||
71b743ddcc | |||
c0206f741f | |||
22bec30621 | |||
49bfd5be09 | |||
6002540268 | |||
cc89303595 | |||
7062d935f4 | |||
9f1deab099 | |||
2cc0368633 | |||
b0a1c20419 | |||
54fcbf88c9 | |||
0ae67c823b | |||
ab4232fb4a | |||
0ec765955e | |||
d505d8530a | |||
fd79710158 | |||
d2ef663dd3 | |||
fec30b1109 | |||
5c53d83f32 | |||
8a7c25fad9 | |||
429069e0cf | |||
50f9fbca23 | |||
cb18feba82 | |||
47b8622018 | |||
92a91d0194 | |||
226a80f138 | |||
5dd7b51fb5 | |||
7b82476e8b | |||
bfc2ca8ad6 | |||
e48b21022c | |||
b4bf91660e | |||
3d62993dfc | |||
679a49823c | |||
106fea9c91 | |||
13132e6da0 | |||
5c478124bc | |||
12613357b3 | |||
95e0cab68c | |||
1d194d445a | |||
bf3fee5ce5 | |||
3c280a3adb | |||
6217524828 | |||
5ef600ff2a | |||
a40d922f42 | |||
dae5f66f81 | |||
347e551194 | |||
000c49c56b | |||
002cc69d2a | |||
af78809ae5 | |||
d531ba648b | |||
a0c650fca3 | |||
af341a984b | |||
122dd4cf53 | |||
27798703b0 | |||
8eb734be8a | |||
616f31ecba | |||
527eec1355 | |||
1966d3008e | |||
bd51b37159 | |||
718b60e12c | |||
d4df87bfff | |||
63007e9b02 | |||
5fe656988c | |||
9cb3a54824 | |||
2f6fd8a31c | |||
8f9ed021d6 | |||
0ef3d3373a | |||
fd2b4a5bbe | |||
1c0d55bdc3 | |||
7c1f99e678 | |||
126e746651 | |||
1c45a16356 | |||
1589f202a9 | |||
55bd7b7fb4 | |||
3c1e6a11ff | |||
9ac78a0d43 | |||
e2bcb34051 | |||
4ea0c19d7b | |||
56740f1f10 | |||
daed30a585 | |||
48d411ac3f | |||
b530366cb8 | |||
975d07056a | |||
24bf113d30 | |||
ca6a810fa3 | |||
62b382eadf | |||
45d8e45137 | |||
70f2308575 | |||
6eb15ec080 | |||
d722c46a74 | |||
d847a34e99 | |||
7b55d1d57c | |||
a25be1069c | |||
5200232a32 | |||
bcd785774b | |||
5ba613df30 | |||
a1dc0a6a58 |
15
Application/Component/Widget/d3GtmStartWidget.php
Normal file
15
Application/Component/Widget/d3GtmStartWidget.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Component\Widget;
|
||||||
|
|
||||||
|
class d3GtmStartWidget extends \OxidEsales\Eshop\Application\Component\Widget\WidgetController
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
parent::render();
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
85
Application/Controller/Admin/GA4AdminUserInterface_main.php
Normal file
85
Application/Controller/Admin/GA4AdminUserInterface_main.php
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Controller\Admin;
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use OxidEsales\Eshop\Core\ViewConfig;
|
||||||
|
|
||||||
|
class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController
|
||||||
|
{
|
||||||
|
protected $_sThisTemplate = 'ga4/admin/d3ga4uimain.tpl';
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3ViewObject', $this);
|
||||||
|
$this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class));
|
||||||
|
$this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList());
|
||||||
|
$this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getActManager());
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save()
|
||||||
|
{
|
||||||
|
parent::save();
|
||||||
|
|
||||||
|
$aParams = Registry::getRequest()->getRequestEscapedParameter('editval');
|
||||||
|
|
||||||
|
$aCheckBoxParams = [
|
||||||
|
'_blEnableGa4',
|
||||||
|
'_blEnableDebug',
|
||||||
|
'_blEnableConsentMode',
|
||||||
|
'_blEnableOwnCookieManager',
|
||||||
|
'_blEnableMeasurementCapabilities',
|
||||||
|
'_blEnableUsercentricsConsentModeApi',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($aCheckBoxParams as $checkBoxName){
|
||||||
|
if (isset($aParams['bool'][$checkBoxName])){
|
||||||
|
$aParams['bool'][$checkBoxName] = true;
|
||||||
|
}else{
|
||||||
|
$aParams['bool'][$checkBoxName] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->d3SaveShopConfigVars($aParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $aParams
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
protected function d3SaveShopConfigVars(array $aParams)
|
||||||
|
{
|
||||||
|
$oConfig = Registry::getConfig();
|
||||||
|
foreach ($aParams as $sConfigType => $aConfigParams) {
|
||||||
|
foreach ($aConfigParams as $sParamName => $sParamValue){
|
||||||
|
if($this->d3GetModuleConfigParam($sParamName) !== $sParamValue){
|
||||||
|
$oConfig->saveShopConfVar(
|
||||||
|
$sConfigType,
|
||||||
|
Constants::OXID_MODULE_ID.$sParamName,
|
||||||
|
$sParamValue,
|
||||||
|
$oConfig->getShopId(),
|
||||||
|
Constants::OXID_MODULE_ID
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $configParamName
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function d3GetModuleConfigParam(string $configParamName)
|
||||||
|
{
|
||||||
|
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName);
|
||||||
|
}
|
||||||
|
}
|
19
Application/Model/CMP/ConsentManagementPlatformBaseModel.php
Normal file
19
Application/Model/CMP/ConsentManagementPlatformBaseModel.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Model\CMP;
|
||||||
|
|
||||||
|
|
||||||
|
abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface
|
||||||
|
{
|
||||||
|
public string $sCMPName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getCMPName(): string
|
||||||
|
{
|
||||||
|
return $this->sCMPName;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Model\CMP;
|
||||||
|
|
||||||
|
interface ConsentManagementPlatformInterface
|
||||||
|
{
|
||||||
|
public function getCMPName();
|
||||||
|
}
|
25
Application/Model/CMP/Usercentrics.php
Normal file
25
Application/Model/CMP/Usercentrics.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Model\CMP;
|
||||||
|
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used the OXID Module.
|
||||||
|
*
|
||||||
|
* Further information's:
|
||||||
|
* https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html
|
||||||
|
*
|
||||||
|
* Usercentrics homepage:
|
||||||
|
* https://usercentrics.com
|
||||||
|
*/
|
||||||
|
class Usercentrics extends ConsentManagementPlatformBaseModel
|
||||||
|
{
|
||||||
|
const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics";
|
||||||
|
const sExternalIncludationInternalName = "usercentrics";
|
||||||
|
const sModuleIncludationPublicName = "( Modul ) Usercentrics";
|
||||||
|
const sModuleIncludationInternalName = "oxps_usercentrics";
|
||||||
|
}
|
11
Application/Model/Constants.php
Normal file
11
Application/Model/Constants.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class Constants
|
||||||
|
{
|
||||||
|
public const OXID_MODULE_ID = 'd3googleanalytics4';
|
||||||
|
}
|
@ -8,46 +8,24 @@ use OxidEsales\Eshop\Core\ViewConfig;
|
|||||||
class ManagerHandler
|
class ManagerHandler
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @param string $sParam
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function getCurrManager() :string
|
public function d3SaveShopConfVar(string $sParam){
|
||||||
{
|
Registry::getConfig()->saveShopConfVar(
|
||||||
/** @var ManagerTypes $oManagerTypes */
|
'select',
|
||||||
$oManagerTypes = oxNew(ManagerTypes::class);
|
Constants::OXID_MODULE_ID."_HAS_STD_MANAGER",
|
||||||
|
$sParam,
|
||||||
/** @var ViewConfig $oViewConfig */
|
Registry::getConfig()->getShopId(),
|
||||||
$oViewConfig = oxNew(ViewConfig::class);
|
Constants::OXID_MODULE_ID
|
||||||
|
);
|
||||||
$aManagerList = $oManagerTypes->getManagerList();
|
|
||||||
|
|
||||||
foreach ($aManagerList as $managerName){
|
|
||||||
if ($oViewConfig->isModuleActive($managerName)){
|
|
||||||
return $managerName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->getExplicitManager();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getModuleSettingExplicitManagerSelectValue() :string
|
public function getActManager() :string
|
||||||
{
|
{
|
||||||
return Registry::getConfig()->getConfigParam('d3_gtm_settings_HAS_STD_MANAGER');
|
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_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";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,41 +2,30 @@
|
|||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Application\Model;
|
namespace D3\GoogleAnalytics4\Application\Model;
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
|
||||||
|
|
||||||
class ManagerTypes
|
class ManagerTypes
|
||||||
{
|
{
|
||||||
#ToDo: make own classes for each of the manager
|
const EXTERNAL_SERVICE = "eigener Service";
|
||||||
|
const INTERNAL_EXTERNAL_SERVICE = "externalService";
|
||||||
|
const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
|
||||||
const EXTERNAL_SERVICE = "externalService";
|
const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager";
|
||||||
const NET_COOKIE_MANAGER = "net_cookie_manager";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Further information's:
|
* Further information's:
|
||||||
* https://github.com/aggrosoft/oxid-cookie-compliance
|
* https://github.com/aggrosoft/oxid-cookie-compliance
|
||||||
*/
|
*/
|
||||||
const AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
|
||||||
|
const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
||||||
|
|
||||||
/**
|
const CONSENTMANAGER = "Consentmanager";
|
||||||
* Used the OXID Module.
|
const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
|
||||||
*
|
|
||||||
* Further information's:
|
|
||||||
* https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html
|
|
||||||
*
|
|
||||||
* Usercentrics homepage:
|
|
||||||
* https://usercentrics.com
|
|
||||||
*/
|
|
||||||
const USERCENTRICS_MODULE = "oxps_usercentrics";
|
|
||||||
|
|
||||||
/**
|
const COOKIEFIRST = "Cookiefirst";
|
||||||
* manually included usercentrics script
|
const INTERNAL_COOKIEFIRST = "cookiefirst";
|
||||||
*/
|
|
||||||
const USERCENTRICS_MANUALLY = "USERCENTRICS";
|
|
||||||
|
|
||||||
const CONSENTMANAGER = "CONSENTMANAGER";
|
const COOKIEBOT = "Cookiebot";
|
||||||
|
const INTERNAL_COOKIEBOT = "cookiebot";
|
||||||
const COOKIEFIRST = "COOKIEFIRST";
|
|
||||||
|
|
||||||
const COOKIEBOT = "COOKIEBOT";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
@ -44,14 +33,14 @@ class ManagerTypes
|
|||||||
public function getManagerList(): array
|
public function getManagerList(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
"externalService" => self::EXTERNAL_SERVICE,
|
self::INTERNAL_EXTERNAL_SERVICE => self::EXTERNAL_SERVICE,
|
||||||
"agcookiecompliance" => self::AGCOOKIECOMPLIANCE,
|
self::INTERNAL_AGCOOKIECOMPLIANCE => self::AGCOOKIECOMPLIANCE,
|
||||||
"net_cookie_manager" => self::NET_COOKIE_MANAGER,
|
self::INTERNAL_NET_COOKIE_MANAGER => self::NET_COOKIE_MANAGER,
|
||||||
"oxps_usercentrics" => self::USERCENTRICS_MODULE,
|
Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName,
|
||||||
"usercentrics" => self::USERCENTRICS_MANUALLY,
|
Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName,
|
||||||
"consentmanager" => self::CONSENTMANAGER,
|
self::INTERNAL_CONSENTMANAGER => self::CONSENTMANAGER,
|
||||||
"cookiefirst" => self::COOKIEFIRST,
|
self::INTERNAL_COOKIEFIRST => self::COOKIEFIRST,
|
||||||
"cookiebot" => self::COOKIEBOT,
|
self::INTERNAL_COOKIEBOT => self::COOKIEBOT,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,6 +50,23 @@ class ManagerTypes
|
|||||||
*/
|
*/
|
||||||
public function isManagerInList(string $sManager) :bool
|
public function isManagerInList(string $sManager) :bool
|
||||||
{
|
{
|
||||||
return in_array($sManager, $this->getManagerList(), true);
|
return in_array($sManager, array_keys($this->getManagerList()), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* the CMP from this method always needs the script tag delivered to the dom.
|
||||||
|
*/
|
||||||
|
public function scriptTagDeliveredByDefaultArray() :array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Usercentrics::sModuleIncludationInternalName,
|
||||||
|
Usercentrics::sExternalIncludationInternalName,
|
||||||
|
ManagerTypes::INTERNAL_CONSENTMANAGER,
|
||||||
|
ManagerTypes::INTERNAL_COOKIEFIRST,
|
||||||
|
ManagerTypes::INTERNAL_COOKIEBOT,
|
||||||
|
ManagerTypes::INTERNAL_EXTERNAL_SERVICE
|
||||||
|
];
|
||||||
|
}
|
||||||
}
|
}
|
124
Application/views/admin/de/d3googleanalytics4_lang.php
Normal file
124
Application/views/admin/de/d3googleanalytics4_lang.php
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
$sLangName = "Deutsch";
|
||||||
|
// -------------------------------
|
||||||
|
// RESOURCE IDENTITFIER = STRING
|
||||||
|
// -------------------------------
|
||||||
|
$aLang = array(
|
||||||
|
'charset' => 'UTF-8',
|
||||||
|
|
||||||
|
'd3mxgoogleanalytics4' => 'Google Analytics 4',
|
||||||
|
'd3mxd3modules' => 'Google Analytics 4',
|
||||||
|
'd3mxgoogleanalytics4set' => 'Einstellungen',
|
||||||
|
|
||||||
|
// Base Translations
|
||||||
|
'D3BASECONFIG' => 'Grundeinstellungen',
|
||||||
|
'D3CLOSE' => 'SchlieĂźen',
|
||||||
|
'D3NONE' => '- keinen -',
|
||||||
|
'D3CONTAINERID' => 'Container-ID',
|
||||||
|
'D3CONTAINERID_HELP' => '<a target="_blank" href="https://github.com/d3datadevelopment/GoogleAnalytics4/blob/master/Docs/README.md#Container-ID" class="text-muted text-decoration-none"><i class="bi bi-book-half"></i> Was ist die <strong>Container-ID</strong>?</a>',
|
||||||
|
'D3ACTIVATEMOD' => 'Modul aktivieren',
|
||||||
|
'D3CNTRLPARAM' => 'Steuerungsparameter',
|
||||||
|
'D3CNTRLPARAM_HELP' => '<a target="_blank" href="https://github.com/d3datadevelopment/GoogleAnalytics4/blob/master/Docs/README.md#steuerungsparameter" class="text-muted text-decoration-none"><i class="bi bi-book-half"></i> Was ist der <strong>Steuerungsparameter</strong>?</a>',
|
||||||
|
'D3INACTIVATEMOD' => 'Modul ist nicht aktiv! Es werden keine Funktionen ausgespielt!',
|
||||||
|
// Usercentrics Dynamische Optionen
|
||||||
|
'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen',
|
||||||
|
|
||||||
|
// Use debug mode?
|
||||||
|
'D3USEDEBUGMODE' => "Debug-Modus aktivieren",
|
||||||
|
'D3USEDEBUGMODE_HELP' => "Der <strong>Debug Modus</strong> setzt an alle DataLayer ( also Daten Sammlungen im Frontend )
|
||||||
|
<strong>'debug_mode': 'true'</strong> und ermöglicht im Google Tag Manager selbst ein detaillierteres
|
||||||
|
Auswerten des einflieĂźenden Datenstroms.",
|
||||||
|
|
||||||
|
// Use Consentmode?
|
||||||
|
'D3USEGOOGLECONSENTMODE' => "Google Consent Mode 'Default Values' akivieren",
|
||||||
|
'D3USEGOOGLECONSENTMODE_HELP' => "Der <trong>Consent Mode 'Default Values'</trong> setzt im Frontend,
|
||||||
|
vor jedem Sammeln und Senden von Daten, einen Befehl der die Bearbeitung der Daten fortlaufend verändert.<br>
|
||||||
|
<br>
|
||||||
|
Diese Veränderte Berarbeitung heißt im Detail, dass der Google Tag Manager ( GTM )
|
||||||
|
bzw. in erster Instanz die Consent Management Platform ( CMP ) keine Daten zur Verarbeitung an Google sendet,
|
||||||
|
bis ein entsprechendes Zustimmungs-Signal vom Kunden explizit erteilt wurde.<br>
|
||||||
|
Die CMP ist sogar derartig restriktiv, dass diese den Datenstrom zum GTM ( Vorinstanz zu Google Analytics )
|
||||||
|
völlig verhindert, solange keine Zustimmung erteilt wurde.<br>
|
||||||
|
<br>
|
||||||
|
Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise
|
||||||
|
aller beteiligten Instanzen; diese bedarf eine detailliertere Konfiguration!<br>",
|
||||||
|
|
||||||
|
// Use CMP?
|
||||||
|
'D3CMPTABTITLE' => 'Cookie Manager Einstellungen',
|
||||||
|
'D3CMPUSEQ' => 'Consent Management Platform ( CMP ) nutzen?',
|
||||||
|
'D3CMPUSEQ_HELP' => '"Eine Consent Management Platform ( CMP ) ist eine Software, mit der Website-Betreiber
|
||||||
|
oder Anbieter von Web-Apps ĂĽber ein Banner oder ein Pop-up eine datenschutzrechtliche
|
||||||
|
Einwilligung der Besucher einholen und speichern, bevor Nutzerdaten ĂĽber
|
||||||
|
Website-Skripte erfasst werden (Tracking)." <a target="_blank" href="https://de.wikipedia.org/wiki/Consent_Management_Platform">Wikipedia Beschreibung</a><br>
|
||||||
|
<br>
|
||||||
|
Um Google Analytics 4 ( <a target="_blank" href="https://marketingplatform.google.com/intl/de/about/analytics/">Google Analytics</a> ) weiterhin nutzen zu können,
|
||||||
|
und dank fortschreitendem Datenschutz unserer personenbezogener Daten, ist das Nutzen eines konformen CMP
|
||||||
|
heute zwangläufig nötig.<br>
|
||||||
|
<br>
|
||||||
|
Diese konformen CMP sind in
|
||||||
|
<a target="_blank" href="https://cmppartnerprogram.withgoogle.com/">offizieller Partnerschaft mit Google ( Liste der Partner )</a>
|
||||||
|
und unterliegen strengen Vorschriften, um ein ordnungsgemäßes Senden und
|
||||||
|
Verarbeiten der Zustimmung unterliegenden Daten sicher stellen zu können.',
|
||||||
|
'D3CMP' => 'Consent Management Platform ( CMP ) wählen',
|
||||||
|
|
||||||
|
// Usercentrics Config
|
||||||
|
// activate Individual Default Values
|
||||||
|
'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "Usercentrics individual 'Default Values' aktiveren",
|
||||||
|
// standard Consent
|
||||||
|
'D3USRCNTRCSCFG_STD_CNST' => "GTM Standard Consent",
|
||||||
|
// activate consent mode API
|
||||||
|
'D3USRCNTRCSCFG_ACT_CNSTMDE_API' => "Usercentrics Consent Mode API aktivieren",
|
||||||
|
// consent mode api
|
||||||
|
'D3USRCNTRCSCFG_CNSTMDE_API' => "Consent Mode API",
|
||||||
|
'D3USRCNTRCSCFG_DOCS' => 'Nähere Infos zu den hier konfigurierbaren Einstellungen entnehmen Sie bitte der offiziellen
|
||||||
|
Dokumentation von Usercentrics selbst: <a target="_blank" href="https://docs.usercentrics.com/#/consent-mode" class="text-primary"><i class="bi bi-book-half"></i> Dokumentation</a>',
|
||||||
|
'D3USRCNTRCSCFG_WARNING' => "Bevor Sie hier Anpassungen machen, konsultieren Sie bitte einen technischen Support!<br>
|
||||||
|
Anpassungen können zu Beeinträchtigungen und Ausfall von Funktionen im Frontend führen!",
|
||||||
|
|
||||||
|
// Additional Config
|
||||||
|
// Server-Side tagging
|
||||||
|
'D3SERVERSIDETAGGING' => 'Server-Side tagging',
|
||||||
|
'D3DETAILED_DESC' => 'Detailliertere Erklärung der Funktion',
|
||||||
|
'D3SERVERSIDETAGGING_HINT' => 'Die Conatiner-ID wird weiterhin unter "Grundeinstellungen" eingetragen!<br><br>
|
||||||
|
"Serverseitiges Tagging ist eine neue Möglichkeit, mit Google Tag Manager Ihre Anwendung geräteübergreifend zu verwalten.<br>
|
||||||
|
Servercontainer verwenden dasselbe Tag-, Trigger- und Variablenmodell, das Sie gewohnt sind.<br>
|
||||||
|
Außerdem bieten sie neue Tools, mit denen Sie Nutzeraktivitäten überall messen können." <br>
|
||||||
|
<br>
|
||||||
|
- Quelle <a href="https://developers.google.com/tag-platform/tag-manager/server-side/intro">Developers-Google Server-Side tagging</a><br>
|
||||||
|
<br>
|
||||||
|
<strong>Verändern Sie die Werte nur, wenn Sie Server-Side tagging verwenden wollen! Gegebenenfalls fragen Sie einen technischen Ansprechpartner.</strong>
|
||||||
|
',
|
||||||
|
'D3SERVERSIDETAGGING_TITLE_ACTIVE' => 'AusfĂĽhrender code',
|
||||||
|
'D3SERVERSIDETAGGING_ACTIVE' => 'Diese Domain wird im <strong>aktiven</strong>-code ausgefĂĽht. Das heiĂźt,
|
||||||
|
dass es sich hierbei um das HTML-Tag <code>script</code> handelt.
|
||||||
|
Dieses kĂĽmmert sich darum, dass die im DataLayer
|
||||||
|
zusammengefassten Daten an den GTM weitergeleitet werden.<br>
|
||||||
|
<br>
|
||||||
|
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
|
||||||
|
<pre>
|
||||||
|
<code>
|
||||||
|
Vorher:
|
||||||
|
https://www.googletagmanager.com/gtm.js?id=
|
||||||
|
|
||||||
|
Nachher:
|
||||||
|
{Domain}?id=
|
||||||
|
</code>
|
||||||
|
</pre>',
|
||||||
|
'D3SERVERSIDETAGGING_TITLE_PASSIVE' => '<u>nicht</u> AusfĂĽhrneder code',
|
||||||
|
'D3SERVERSIDETAGGING_PASSIVE' => 'Diese Domain wird im <strong>passiven</strong>-code ausgefĂĽht. Das heiĂźt,
|
||||||
|
dass es sich hierbei um das HTML-Tag <code>noscript</code> handelt.
|
||||||
|
Dieses wird ausgefĂĽhrt, wenn aus einem bestimmten Grund
|
||||||
|
das Javascript nicht ausgefĂĽhrt wird.<br>
|
||||||
|
( keine Cookies erlaubt, JavaScript-Unterbindung, ... )
|
||||||
|
<br>
|
||||||
|
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
|
||||||
|
<pre>
|
||||||
|
<code>
|
||||||
|
Vorher:
|
||||||
|
src="https://www.googletagmanager.com/ns.html?id={Container-ID}"
|
||||||
|
|
||||||
|
Nachher:
|
||||||
|
src="{Domain}?id={Container-ID}"
|
||||||
|
</code>
|
||||||
|
</pre>',
|
||||||
|
);
|
@ -10,6 +10,8 @@
|
|||||||
* @link https://www.oxidmodule.com
|
* @link https://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\Constants as Constants;
|
||||||
|
|
||||||
$style = '<style type="text/css">
|
$style = '<style type="text/css">
|
||||||
.groupExp a.rc b {font-size:medium;color:#ff3600;}
|
.groupExp a.rc b {font-size:medium;color:#ff3600;}
|
||||||
.groupExp dt .txt,
|
.groupExp dt .txt,
|
||||||
@ -22,32 +24,87 @@ input.confinput:hover {outline:3px solid #ff3600;}
|
|||||||
</style>';
|
</style>';
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
'SHOP_MODULE_d3_gtm_sContainerID' => 'Container ID',
|
|
||||||
'SHOP_MODULE_GROUP_d3_gtm_settings' => 'Einstellungen',
|
// STD-Einstellungen
|
||||||
'SHOP_MODULE_d3_gtm_blGA4enab' => 'GA4 Aktivieren',
|
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_settings' => 'Einstellungen',
|
||||||
'SHOP_MODULE_d3_gtm_blUAenabled' => 'UA Aktivieren',
|
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sContainerID' => 'Container ID',
|
||||||
'SHOP_MODULE_d3_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blGA4enab' => 'GA4 Aktivieren',
|
||||||
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blUAenabled' => 'UA Aktivieren',
|
||||||
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blEnableDebug' => 'Debug-Modus aktivieren',
|
||||||
|
|
||||||
|
// Serverside - tagging
|
||||||
|
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_serversidetagging' => 'Server-Side tagging',
|
||||||
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_js' => 'Servercontainer AusfĂĽhrender-Code',
|
||||||
|
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_js' => 'Diese Domain wird im <strong>aktiven</strong>-code ausgefĂĽht. Das heiĂźt,
|
||||||
|
dass es sich hierbei um das HTML-Tag <code>script</code> handelt.
|
||||||
|
Dieses kĂĽmmert sich darum, dass die, im data_layer
|
||||||
|
zusammengefassten Daten an den GTM weitergeleitet werden.<br>
|
||||||
|
<br>
|
||||||
|
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
|
||||||
|
<pre>
|
||||||
|
<code>
|
||||||
|
Vorher:
|
||||||
|
https://www.googletagmanager.com/gtm.js?id=
|
||||||
|
|
||||||
|
Nachher:
|
||||||
|
{Domain}?id=
|
||||||
|
</code>
|
||||||
|
</pre>
|
||||||
|
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
|
||||||
|
',
|
||||||
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_nojs' => 'Servercontainer NICHT AusfĂĽhrender-Code<br><br>
|
||||||
|
"Serverseitiges Tagging ist eine neue Möglichkeit, mit Google Tag Manager Ihre Anwendung geräteübergreifend zu verwalten.<br>
|
||||||
|
Servercontainer verwenden dasselbe Tag-, Trigger- und Variablenmodell, das Sie gewohnt sind.<br>
|
||||||
|
Außerdem bieten sie neue Tools, mit denen Sie Nutzeraktivitäten überall messen können." <br>
|
||||||
|
<br>
|
||||||
|
- Quelle <a href="https://developers.google.com/tag-platform/tag-manager/server-side/intro">Developers-Google Server-Side tagging</a><br>
|
||||||
|
<br>
|
||||||
|
<strong>Verändern Sie die Werte nur, wenn Sie Server-Side tagging verwenden wollen!</strong>
|
||||||
|
',
|
||||||
|
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_nojs' => 'Diese Domain wird im <strong>passiven</strong>-code ausgefĂĽht. Das heiĂźt,
|
||||||
|
dass es sich hierbei um das HTML-Tag <code>noscript</code> handelt.
|
||||||
|
Dieses wird ausgefĂĽhrt, wenn aus einem bestimmten Grund
|
||||||
|
das Javascript nicht ausgefĂĽhrt wird.<br>
|
||||||
|
( keine Cookies erlaubt, JavaScript-Unterbindung, ... )
|
||||||
|
<br>
|
||||||
|
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
|
||||||
|
<pre>
|
||||||
|
<code>
|
||||||
|
Vorher:
|
||||||
|
src="https://www.googletagmanager.com/ns.html?id={Container-ID}"
|
||||||
|
|
||||||
|
Nachher:
|
||||||
|
src="{Domain}?id={Container-ID}"
|
||||||
|
</code>
|
||||||
|
</pre>
|
||||||
|
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
|
||||||
|
',
|
||||||
|
|
||||||
// for cookie manager settings
|
// for cookie manager settings
|
||||||
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_cookiemanager' => 'Cookie Manager Einstellungen',
|
||||||
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Cookie Manager nutzen?',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_hasOwnCookieManager' => 'Cookie Manager nutzen?',
|
||||||
'HELP_SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Mehr Informationen zu den genannten Coookie-Manager finden Sie auf den folgenden Home-Pages<br><br>
|
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER' => 'Mehr Informationen zu den genannten Coookie-Manager finden Sie auf den folgenden Home-Pages<br><br>
|
||||||
<a href="https://consentmanager.net/">Consentmanager</a><br>
|
<a href="https://consentmanager.net/">Consentmanager</a><br>
|
||||||
<a href="https://usercentrics.com/">Usercentrics</a><br>
|
<a href="https://usercentrics.com/">Usercentrics</a><br>
|
||||||
<a href="https://cookiefirst.com">Cookiefirst</a><br>
|
<a href="https://cookiefirst.com">Cookiefirst</a><br>
|
||||||
<hr>
|
<hr>
|
||||||
Bei weiteren Fragen stehen wir gern zur VerfĂĽgung! Kontaktieren Sie uns einfach unter <a href="https://www.d3data.de/">https://www.d3data.de/</a>',
|
Bei weiteren Fragen stehen wir gern zur VerfĂĽgung! Kontaktieren Sie uns einfach unter <a href="https://www.d3data.de/">https://www.d3data.de/</a>',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?<br>
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?<br>
|
||||||
Dann wählen Sie bitte die zutreffende aus.',
|
Dann wählen Sie bitte die zutreffende aus.',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_NONE' => '---',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_NONE' => '---',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
|
||||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
|
||||||
'SHOP_MODULE_d3_gtm_settings_controlParameter' => 'Steuerungsparameter',
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_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>
|
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_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>
|
<strong>Beachte:</strong><br>
|
||||||
Sofern Sie die <a target="_blank" href="https://consentmanager.net" style="color: blue">consentmanager</a> CMP verwenden,
|
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.
|
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.
|
||||||
'
|
',
|
||||||
|
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blActivateConsentMode' => "Google Consent Mode 'Default Values' aktivieren",
|
||||||
|
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blActivateConsentMode' => 'Diese Einstellung ist zu aktivieren, wenn Sie den Google-Consent-Mode ( Einwilligungsmodus ) verwenden wollen.
|
||||||
|
<hr>
|
||||||
|
"Im Einwilligungsmodus können Sie Google über den Cookie- oder App-ID-Einwilligungsstatus Ihrer Nutzer informieren.
|
||||||
|
Mit Tags wird das Verhalten angepasst. Dabei werden die Einstellungen der Nutzer berĂĽcksichtigt." ~ <a href="https://support.google.com/google-ads/answer/10000067">Google Einwilligungsmodus</a>',
|
||||||
];
|
];
|
||||||
|
108
Application/views/admin/tpl/d3googleanalytics4_headitem.tpl
Normal file
108
Application/views/admin/tpl/d3googleanalytics4_headitem.tpl
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>[{$title}]</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=[{$charset}]">
|
||||||
|
[{if isset($meta_refresh_sec,$meta_refresh_url)}]
|
||||||
|
<meta http-equiv=Refresh content="[{$meta_refresh_sec}];URL=[{$meta_refresh_url|replace:"&":"&"}]">
|
||||||
|
[{/if}]
|
||||||
|
<link rel="shortcut icon" href="[{$oViewConf->getBaseDir()}]favicon.ico">
|
||||||
|
|
||||||
|
[{block name="admin_headitem_inccss"}]
|
||||||
|
<link rel="stylesheet" href="[{$oViewConf->getResourceUrl()}]main.css">
|
||||||
|
<link rel="stylesheet" href="[{$oViewConf->getResourceUrl()}]colors_[{$oViewConf->getEdition()|lower}].css">
|
||||||
|
<link rel="stylesheet" type="text/css" href="[{$oViewConf->getResourceUrl()}]yui/build/assets/skins/sam/container.css">
|
||||||
|
[{/block}]
|
||||||
|
|
||||||
|
[{block name="admin_headitem_incjs"}]
|
||||||
|
<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]yui/build/utilities/utilities.js"></script>
|
||||||
|
<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]yui/build/container/container-min.js"></script>
|
||||||
|
<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]yui/oxid-help.js"></script>
|
||||||
|
[{/block}]
|
||||||
|
|
||||||
|
[{block name="admin_headitem_js"}]
|
||||||
|
<script type="text/javascript">
|
||||||
|
<!--
|
||||||
|
// standard messages
|
||||||
|
var sUnassignMessage = "[{oxmultilang ident='GENERAL_YOUWANTTOUNASSIGN'}]";
|
||||||
|
var sDeleteMessage = "[{oxmultilang ident='GENERAL_YOUWANTTODELETE'}]";
|
||||||
|
|
||||||
|
// class info
|
||||||
|
var sDefClass = '[{$default_edit}]';
|
||||||
|
var sActClass = '[{$actlocation}]';
|
||||||
|
|
||||||
|
[{if $updatelist == 1}]
|
||||||
|
window.onload = function ()
|
||||||
|
{
|
||||||
|
top.oxid.admin.updateList('[{$oxid}]');
|
||||||
|
}
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
|
||||||
|
var ajaxpopup = null;
|
||||||
|
function showDialog( sParams )
|
||||||
|
{
|
||||||
|
ajaxpopup = window.open('[{$oViewConf->getSelfLink()|replace:"&":"&"}]'+sParams, 'ajaxpopup', 'width=850,height=680,scrollbars=yes,resizable=yes');
|
||||||
|
}
|
||||||
|
|
||||||
|
function focusPopup()
|
||||||
|
{
|
||||||
|
if ( ajaxpopup )ajaxpopup.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onclick = focusPopup;
|
||||||
|
|
||||||
|
function cleanupLongDesc( sValue )
|
||||||
|
{
|
||||||
|
if ( sValue == '<br>' || sValue == '<br />' ) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return sValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyLongDesc( sIdent )
|
||||||
|
{
|
||||||
|
var textVal = null;
|
||||||
|
try {
|
||||||
|
if ( WPro.editors[sIdent] != null ) {
|
||||||
|
WPro.editors[sIdent].prepareSubmission();
|
||||||
|
textVal = cleanupLongDesc( WPro.editors[sIdent].getValue() );
|
||||||
|
}
|
||||||
|
} catch(err) {
|
||||||
|
var varEl = document.getElementById(sIdent);
|
||||||
|
if (varEl != null) {
|
||||||
|
textVal = cleanupLongDesc( varEl.value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (textVal == null) {
|
||||||
|
var varName = 'editor_'+sIdent;
|
||||||
|
var varEl = document.getElementById(varName);
|
||||||
|
if (varEl != null) {
|
||||||
|
textVal = cleanupLongDesc( varEl.value );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (textVal != null) {
|
||||||
|
var oTarget = document.getElementsByName( 'editval['+ sIdent + ']' );
|
||||||
|
if ( oTarget != null && ( oField = oTarget.item( 0 ) ) != null ) {
|
||||||
|
oField.value = textVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-->
|
||||||
|
</script>
|
||||||
|
[{/block}]
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
[{include file="tooltips.tpl"}]
|
||||||
|
<div id="oxajax_data"></div>
|
||||||
|
|
||||||
|
<div class="[{$box|default:'box'}]" style="height: 100%;">
|
||||||
|
[{include file="inc_error.tpl" Errorlist=$Errors.default}]
|
||||||
|
|
||||||
|
<!-- Input help popup -->
|
||||||
|
<div id="helpTextContainer" class="yui-skin-sam">
|
||||||
|
<div id="helpPanel"></div>
|
||||||
|
</div>
|
197
Application/views/admin/tpl/d3googleanalytics4_main.tpl
Normal file
197
Application/views/admin/tpl/d3googleanalytics4_main.tpl
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
[{include file="ga4/admin/d3ga4uiheaditem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||||
|
|
||||||
|
[{if $readonly}]
|
||||||
|
[{assign var="readonly" value="readonly disabled"}]
|
||||||
|
[{else}]
|
||||||
|
[{assign var="readonly" value=""}]
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<form name="d3gtmformedit" id="d3gtmformedit" action="[{$oViewConf->getSelfLink()}]" enctype="multipart/form-data" method="post">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
[{$oViewConf->getHiddenSid()}]
|
||||||
|
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
|
||||||
|
<input type="hidden" name="fnc" value="">
|
||||||
|
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
|
||||||
|
|
||||||
|
<div class="card mb-5">
|
||||||
|
<div class="card-header">
|
||||||
|
[{oxmultilang ident="D3BASECONFIG"}]
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="form-check mb-3">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" name="editval[bool][_blEnableGa4]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableGa4')}]checked[{/if}] id="blGA4enab">
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
[{oxmultilang ident="D3ACTIVATEMOD"}] [{if false === $d3ViewObject->d3GetModuleConfigParam('_blEnableGa4')}]<span style="color: red">[{oxmultilang ident="D3INACTIVATEMOD"}]</span>[{/if}]
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<div class="input-group w-50">
|
||||||
|
<span class="input-group-text" id="basic-addon3">[{oxmultilang ident="D3CONTAINERID"}]</span>
|
||||||
|
<input type="text" class="form-control" id="_sContainerID" name="editval[str][_sContainerID]" aria-describedby="basic-addon3" value="[{$d3ViewObject->d3GetModuleConfigParam('_sContainerID')}]">
|
||||||
|
</div>
|
||||||
|
<div class="text-muted">[{oxmultilang ident="D3CONTAINERID_HELP"}]</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="_blEnableDebug" name="editval[bool][_blEnableDebug]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableDebug')}]checked[{/if}]>
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
[{oxmultilang ident="D3USEDEBUGMODE"}][{oxinputhelp ident="D3USEDEBUGMODE_HELP"}]
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="_blActivateConsentMode" name="editval[bool][_blEnableConsentMode]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableConsentMode')}]checked[{/if}]>
|
||||||
|
<label class="form-check-label" for="flexCheckChecked">
|
||||||
|
[{oxmultilang ident="D3USEGOOGLECONSENTMODE"}][{oxinputhelp ident="D3USEGOOGLECONSENTMODE_HELP"}]
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" name="save" class="btn btn-light" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="card border border-0">
|
||||||
|
<div class="accordion" id="accordionPanelsStayOpenExample">
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2 class="accordion-header">
|
||||||
|
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-cmpsettings" aria-expanded="true" aria-controls="panelsStayOpen-cmpsettings">
|
||||||
|
[{oxmultilang ident="D3CMPTABTITLE"}]
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id="panelsStayOpen-cmpsettings" class="accordion-collapse collapse show">
|
||||||
|
<div class="accordion-body">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" name="editval[bool][_blEnableOwnCookieManager]" value="" id="_hasOwnCookieManager" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableOwnCookieManager')}]checked[{/if}]>
|
||||||
|
<label class="form-check-label" for="flexCheckChecked">
|
||||||
|
[{oxmultilang ident="D3CMPUSEQ"}][{oxinputhelp ident="D3CMPUSEQ_HELP"}]
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label>
|
||||||
|
[{oxmultilang ident="D3CMP"}]
|
||||||
|
</label>
|
||||||
|
<select class="form-select w-50" name="editval[select][_HAS_STD_MANAGER]" aria-label="Default select example">
|
||||||
|
[{foreach from=$d3ManagerTypeArray key="sInternalName" item="sPublicName" name="editval[aCmpNameArray]"}]
|
||||||
|
<option value="[{$sInternalName}]" [{if $sInternalName === $d3CurrentCMP}]SELECTED[{/if}]>[{$sPublicName}]</option>
|
||||||
|
[{/foreach}]
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<div class="input-group w-75">
|
||||||
|
<span class="input-group-text" id="basic-addon3">[{oxmultilang ident="D3CNTRLPARAM"}]</span>
|
||||||
|
<input type="text" class="form-control" id="_controlParameter" name="editval[str][_sControlParameter]" value="[{$d3ViewObject->d3GetModuleConfigParam('_sControlParameter')}]" aria-describedby="basic-addon3">
|
||||||
|
</div>
|
||||||
|
<div class="text-muted">[{oxmultilang ident="D3CNTRLPARAM_HELP"}]</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2 class="accordion-header">
|
||||||
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-serversidetagging" aria-expanded="false" aria-controls="panelsStayOpen-serversidetagging">
|
||||||
|
[{oxmultilang ident="D3SERVERSIDETAGGING"}]
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id="panelsStayOpen-serversidetagging" class="accordion-collapse collapse">
|
||||||
|
<div class="accordion-body">
|
||||||
|
<div class="card bg-light rounded mb-3">
|
||||||
|
<div class="card-body">
|
||||||
|
[{oxmultilang ident="D3SERVERSIDETAGGING_HINT"}]
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_ACTIVE"}]</span>
|
||||||
|
<input type="text" class="form-control" id="_serversidetagging_js" name="editval[str][_sServersidetagging_js]" value="[{$d3ViewObject->d3GetModuleConfigParam('_sServersidetagging_js')}]" aria-describedby="basic-addon3">
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_PASSIVE"}]</span>
|
||||||
|
<input type="text" class="form-control" id="_serversidetagging_nojs" name="editval[str][_sServersidetagging_nojs]" value="[{$d3ViewObject->d3GetModuleConfigParam('_sServersidetagging_nojs')}]" aria-describedby="basic-addon3">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button type="button" class="btn btn-light mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">
|
||||||
|
[{oxmultilang ident="D3DETAILED_DESC"}]
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-body">
|
||||||
|
<h4>[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_ACTIVE"}]</h4>
|
||||||
|
[{oxmultilang ident="D3SERVERSIDETAGGING_ACTIVE"}]
|
||||||
|
<hr>
|
||||||
|
<h4>[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_PASSIVE"}]</h4>
|
||||||
|
[{oxmultilang ident="D3SERVERSIDETAGGING_PASSIVE"}]
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">[{oxmultilang ident="D3CLOSE"}]</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
[{if $d3ViewConfObject->d3IsUsercentricsCMPChosen()}]
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2 class="accordion-header">
|
||||||
|
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-usercentricsdynamicoptions" aria-expanded="false" aria-controls="panelsStayOpen-usercentricsdynamicoptions">
|
||||||
|
[{oxmultilang ident="D3USRCNTRCSDYNOPT"}]
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id="panelsStayOpen-usercentricsdynamicoptions" class="accordion-collapse collapse">
|
||||||
|
<div class="accordion-body">
|
||||||
|
<div class="card bg-light rounded mb-3">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="text-danger mb-3">
|
||||||
|
[{oxmultilang ident="D3USRCNTRCSCFG_WARNING"}]
|
||||||
|
</div>
|
||||||
|
[{oxmultilang ident="D3USRCNTRCSCFG_DOCS"}]
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="enabledefaultmeasurementvalues" name="editval[bool][_blEnableMeasurementCapabilities]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableMeasurementCapabilities')}]checked[{/if}]>
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
[{oxmultilang ident="D3USRCNTRCSCFG_ACT_INDIVDEFVAL"}]
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3USRCNTRCSCFG_STD_CNST"}]</span>
|
||||||
|
<textarea name="editval[str][_sMeasurementCapabilities]" class="form-control" rows="15">[{$d3ViewObject->d3GetModuleConfigParam('_sDefaultMeasurementCapabilities')}]</textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" value="" id="enableUsercentricsConsentModeApi" name="editval[bool][_blEnableUsercentricsConsentModeApi]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi')}]checked[{/if}]>
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
[{oxmultilang ident="D3USRCNTRCSCFG_ACT_CNSTMDE_API"}]
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3USRCNTRCSCFG_CNSTMDE_API"}]</span>
|
||||||
|
<textarea name="editval[str][_sUsercentricsConsentModeApi]" class="form-control" rows="40">[{$d3ViewObject->d3GetModuleConfigParam('_sDefaultUsercentricsConsentModeApi')}]</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
[{/if}]
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
@ -1,11 +1,41 @@
|
|||||||
[{* Always prepare the data layer to avoid errors *}]
|
[{* Always prepare the data layer to avoid errors *}]
|
||||||
<script>
|
[{if $oViewConf->isGA4enabled()}]
|
||||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
[{assign var="d3GtmContainerIdString" value=$oViewConf->getGtmContainerId()}]
|
||||||
</script>
|
<script>
|
||||||
|
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||||
|
</script>
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
[{if $oViewConf->D3blShowGtmScript()}]
|
[{if $oViewConf->isGA4enabled() and $oViewConf->D3blShowGtmScript()}]
|
||||||
[{if $oViewConf->getGtmContainerId()}]
|
[{if $d3GtmContainerIdString}]
|
||||||
[{strip}]
|
[{strip}]
|
||||||
|
|
||||||
|
[{if $oViewConf->isGtmConsentModeSetActivated()}]
|
||||||
|
<script type="text/javascript">
|
||||||
|
[{if $oViewConf->d3IsUsercentricsCMPChosen() and $oViewConf->d3GetModuleConfigParam('_blEnableMeasurementCapabilities')}]
|
||||||
|
[{$oViewConf->d3GetModuleConfigParam('_sMeasurementCapabilities')|strip}]
|
||||||
|
[{else}]
|
||||||
|
function gtag() {
|
||||||
|
dataLayer.push(arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
gtag("consent", "default", {
|
||||||
|
ad_user_data: "denied",
|
||||||
|
ad_personalization: "denied",
|
||||||
|
ad_storage: "denied",
|
||||||
|
analytics_storage: "denied",
|
||||||
|
wait_for_update: 2000
|
||||||
|
});
|
||||||
|
[{/if}]
|
||||||
|
</script>
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
[{if $oViewConf->d3IsUsercentricsCMPChosen() and $oViewConf->d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi')}]
|
||||||
|
<script type="text/javascript">
|
||||||
|
[{$oViewConf->d3GetModuleConfigParam('_sUsercentricsConsentModeApi')|strip}]
|
||||||
|
</script>
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
<!-- Google Tag Manager -->
|
<!-- Google Tag Manager -->
|
||||||
<script [{$oViewConf->getGtmScriptAttributes()}]>
|
<script [{$oViewConf->getGtmScriptAttributes()}]>
|
||||||
(function (w, d, s, l, i) {
|
(function (w, d, s, l, i) {
|
||||||
@ -13,9 +43,9 @@
|
|||||||
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
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 : '';
|
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||||
j.async = true;
|
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);
|
f.parentNode.insertBefore(j, f);
|
||||||
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
})(window, document, 'script', 'dataLayer', '[{$d3GtmContainerIdString}]');
|
||||||
</script>
|
</script>
|
||||||
<!-- End Google Tag Manager -->
|
<!-- End Google Tag Manager -->
|
||||||
[{/strip}]
|
[{/strip}]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||||
<!-- Google Tag Manager (noscript) -->
|
<!-- Google Tag Manager (noscript) -->
|
||||||
<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>
|
height="0" width="0" style="display:none;visibility:hidden"></iframe>
|
||||||
</noscript>
|
</noscript>
|
||||||
<!-- End Google Tag Manager (noscript) -->
|
<!-- End Google Tag Manager (noscript) -->
|
||||||
|
3
Application/views/blocks/add_payment_info.tpl
Normal file
3
Application/views/blocks/add_payment_info.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/add_payment_info.tpl"}]
|
3
Application/views/blocks/begin_checkout.tpl
Normal file
3
Application/views/blocks/begin_checkout.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/begin_checkout.tpl"}]
|
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
3
Application/views/blocks/page_list_listbody.tpl
Normal file
3
Application/views/blocks/page_list_listbody.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,56 +1,3 @@
|
|||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
[{block name="d3_ga4_purchase_block"}]
|
[{include file="event/purchase.tpl"}]
|
||||||
[{capture assign=d3_ga4_purchase}]
|
|
||||||
[{strip}]
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
[{assign var="gtmOrder" value=$oView->getOrder()}]
|
|
||||||
[{assign var="gtmBasket" value=$oView->getBasket()}]
|
|
||||||
[{assign var="gtmArticles" value=$gtmOrder->getOrderArticles()}]
|
|
||||||
[{assign var="gtmOrderVouchers" value=$gtmOrder->getVoucherNrList()}]
|
|
||||||
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'purchase',
|
|
||||||
'eventLabel':'Checkout Step 5',
|
|
||||||
'ecommerce': {
|
|
||||||
'transaction_id': '[{$gtmOrder->getFieldData("oxordernr")}]',
|
|
||||||
'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]',
|
|
||||||
'value': [{$gtmOrder->getTotalOrderSum()}],
|
|
||||||
'tax': [{math equation="x+y" x=$gtmOrder->getFieldData("oxartvatprice1") y=$gtmOrder->getFieldData("oxartvatprice2") }],
|
|
||||||
'shipping': [{$gtmOrder->getFieldData("oxdelcost")}],
|
|
||||||
'currency': '[{$gtmOrder->getFieldData('oxcurrency')}]',
|
|
||||||
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
|
||||||
'paymentType': '[{$gtmBasket->getPaymentOnPaymentId()}]',
|
|
||||||
'items': [
|
|
||||||
[{foreach from=$gtmArticles item="gtmBasketItem" name="gtmArticles"}]
|
|
||||||
[{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}]
|
|
||||||
[{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}]
|
|
||||||
[{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}]
|
|
||||||
|
|
||||||
{
|
|
||||||
'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]',
|
|
||||||
'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
|
||||||
'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
|
||||||
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
|
||||||
'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]',
|
|
||||||
[{if $gtmPurchaseItemCategory}]
|
|
||||||
'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0)}]',
|
|
||||||
'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1)}]',
|
|
||||||
'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2)}]',
|
|
||||||
'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3)}]',
|
|
||||||
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
|
|
||||||
[{/if}]
|
|
||||||
'price': [{$gtmPurchaseItemPriceObject->getPrice()}],
|
|
||||||
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
|
|
||||||
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
|
||||||
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}[{if $oViewConf->isDebugModeOn()}],
|
|
||||||
'debug_mode': 'true'
|
|
||||||
[{/if}]
|
|
||||||
})
|
|
||||||
[{/strip}]
|
|
||||||
[{/capture}]
|
|
||||||
[{oxscript add=$d3_ga4_purchase}]
|
|
||||||
[{/block}]
|
|
||||||
|
3
Application/views/blocks/remove_from_cart.tpl
Normal file
3
Application/views/blocks/remove_from_cart.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/remove_from_cart.tpl"}]
|
3
Application/views/blocks/start_welcome_text.tpl
Normal file
3
Application/views/blocks/start_welcome_text.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,50 +1,3 @@
|
|||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
[{include file="event/view_cart.tpl"}]
|
||||||
|
|
||||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
|
||||||
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
|
||||||
|
|
||||||
[{block name="d3_ga4_view_cart_block"}]
|
|
||||||
[{capture assign=d3_ga4_view_cart}]
|
|
||||||
[{strip}]
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'view_cart',
|
|
||||||
'eventLabel':'Checkout Step 1',
|
|
||||||
'ecommerce': {
|
|
||||||
'actionField': "step: 1",
|
|
||||||
'currency': "[{$currency->name}]",
|
|
||||||
'value': [{$d3BasketPrice->getPrice()}],
|
|
||||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
|
||||||
'items': [
|
|
||||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
|
||||||
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
|
||||||
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
|
||||||
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
|
||||||
{
|
|
||||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
|
||||||
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
|
||||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
|
||||||
[{if $gtmBasketItemCategory}]
|
|
||||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0)}]',
|
|
||||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1)}]',
|
|
||||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2)}]',
|
|
||||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]',
|
|
||||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
|
||||||
[{/if}]
|
|
||||||
'price': [{$d3oItemPrice->getPrice()}],
|
|
||||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
|
||||||
'quantity': [{$basketitem->getAmount()}],
|
|
||||||
'position': [{$smarty.foreach.gtmCartContents.index}]
|
|
||||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}[{if $oViewConf->isDebugModeOn()}],
|
|
||||||
'debug_mode': 'true'
|
|
||||||
[{/if}]
|
|
||||||
});
|
|
||||||
[{/strip}]
|
|
||||||
[{/capture}]
|
|
||||||
[{oxscript add=$d3_ga4_view_cart}]
|
|
||||||
[{/block}]
|
|
||||||
|
@ -1,40 +1,3 @@
|
|||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
||||||
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
|
|
||||||
[{block name="d3_ga4_view_item_block"}]
|
[{include file="event/view_item.tpl"}]
|
||||||
[{capture assign=d3_ga4_view_item}]
|
|
||||||
[{strip}]
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'view_item',
|
|
||||||
'eventLabel':'Product View',
|
|
||||||
'ecommerce': {
|
|
||||||
'currency': '[{$currency->name}]',
|
|
||||||
'items': [
|
|
||||||
{
|
|
||||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
|
||||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
|
|
||||||
[{if $gtmCategory}]
|
|
||||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
|
||||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
|
||||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
|
||||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
|
||||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
|
||||||
[{/if}]
|
|
||||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
|
||||||
'price': [{$d3PriceObject->getPrice()}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}[{if $oViewConf->isDebugModeOn()}],
|
|
||||||
'debug_mode': 'true'
|
|
||||||
[{/if}]
|
|
||||||
});
|
|
||||||
[{/strip}]
|
|
||||||
[{/capture}]
|
|
||||||
[{oxscript add=$d3_ga4_view_item}]
|
|
||||||
[{/block}]
|
|
||||||
|
3
Application/views/blocks/view_item_list.tpl
Normal file
3
Application/views/blocks/view_item_list.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/view_item_list.tpl"}]
|
3
Application/views/blocks/view_search_result.tpl
Normal file
3
Application/views/blocks/view_search_result.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{include file="event/view_search_result.tpl"}]
|
53
Application/views/event/add_payment_info.tpl
Normal file
53
Application/views/event/add_payment_info.tpl
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||||
|
|
||||||
|
[{assign var="gtmBasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||||
|
[{assign var="gtmBasketObject" value=$oxcmp_basket}]
|
||||||
|
[{assign var='gtmCartArticles' value=$gtmBasketObject->getBasketArticles()}]
|
||||||
|
[{assign var="gtmPaymentObject" value=$oView->getPayment()}]
|
||||||
|
|
||||||
|
[{block name="gtm_ga4_add_payment_info_block"}]
|
||||||
|
[{capture name="gtm_ga4_add_payment_info"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'add_payment_info',
|
||||||
|
'eventLabel':'Checkout - Payment info',
|
||||||
|
'payment_type':'[{$gtmPaymentObject->gtmGetSelectedPaymentName()}]',
|
||||||
|
'ecommerce':
|
||||||
|
{
|
||||||
|
'actionField': "Payment-Info",
|
||||||
|
'currency': "[{$currency->name}]",
|
||||||
|
'value': [{$gtmBasketPrice->getPrice()}],
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'items':
|
||||||
|
[
|
||||||
|
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||||
|
[{assign var="gtmItemPriceObject" value=$basketitem->getPrice()}]
|
||||||
|
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||||
|
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||||
|
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||||
|
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||||
|
[{if $gtmBasketItemCategory}]
|
||||||
|
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmItemPriceObject->getPrice()}],[{/oxhasrights}]
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'quantity': [{$basketitem->getAmount()}],
|
||||||
|
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||||
|
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.gtm_ga4_add_payment_info}]
|
||||||
|
[{/block}]
|
61
Application/views/event/add_to_cart.tpl
Normal file
61
Application/views/event/add_to_cart.tpl
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
|
||||||
|
[{if $d3CmpBasket && $d3CmpBasket->getAddToBasketDecision() && $d3CmpBasket->d3GtmRequestedArticleLoadedByAnid() !== null}]
|
||||||
|
[{assign var="oGtmProduct" value=$d3CmpBasket->d3GtmRequestedArticleLoadedByAnid()}]
|
||||||
|
[{assign var="oGtmAmountArticlesAdded" value=$d3CmpBasket->getD3GtmAddToCartAmountArticles()}]
|
||||||
|
[{*$smarty.block.parent*}]
|
||||||
|
[{* variable $oGtmProduct is passed from parent tempalte *}]
|
||||||
|
[{assign var="d3PriceObject" value=$oGtmProduct->getPrice()}]
|
||||||
|
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
||||||
|
[{assign var="gtmManufacturer" value=$oGtmProduct->getManufacturer()}]
|
||||||
|
[{assign var="gtmCategory" value=$oGtmProduct->getCategory()}]
|
||||||
|
|
||||||
|
[{block name="d3_ga4_add_to_cart_list_block"}]
|
||||||
|
[{capture name="d3_ga4_add_to_cart_listtpl"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
|
||||||
|
[{*** Debug cases ***}]
|
||||||
|
[{*event.preventDefault();*}]
|
||||||
|
|
||||||
|
let iArtQuantity = $("[{$htmlIdAmountOfArticles}]").val();
|
||||||
|
let iArtQuantityAdded = [{$oGtmAmountArticlesAdded}];
|
||||||
|
|
||||||
|
if(!iArtQuantity && (iArtQuantityAdded === 1)){
|
||||||
|
iArtQuantity = 1;
|
||||||
|
}else{
|
||||||
|
iArtQuantity = iArtQuantityAdded;
|
||||||
|
}
|
||||||
|
|
||||||
|
dataLayer.push({
|
||||||
|
'isAddToBasket': true,
|
||||||
|
'event':'add_to_cart',
|
||||||
|
'eventLabel': 'add_to_cart',
|
||||||
|
'ecommerce': {
|
||||||
|
'currency': "[{$currency->name}]",
|
||||||
|
'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
|
||||||
|
'items': [
|
||||||
|
{
|
||||||
|
'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]',
|
||||||
|
'item_name': '[{$oGtmProduct->getFieldData('oxtitle')}]',
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||||
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
|
'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->getFieldData('oxvarselect')}][{/if}]',
|
||||||
|
[{if $gtmCategory}]
|
||||||
|
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
'quantity': iArtQuantity
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_add_to_cart_listtpl}]
|
||||||
|
[{/block}]
|
||||||
|
[{/if}]
|
52
Application/views/event/begin_checkout.tpl
Normal file
52
Application/views/event/begin_checkout.tpl
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||||
|
|
||||||
|
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||||
|
[{assign var="d3BasketObject" value=$oxcmp_basket}]
|
||||||
|
[{assign var='gtmCartArticles' value=$d3BasketObject->getBasketArticles()}]
|
||||||
|
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
||||||
|
|
||||||
|
[{block name="d3_ga4_begin_checkout_block"}]
|
||||||
|
[{capture name="d3_ga4_begin_checkout"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'begin_checkout',
|
||||||
|
'eventLabel':'Begin of checkout',
|
||||||
|
'ecommerce':
|
||||||
|
{
|
||||||
|
'actionField': "Begin",
|
||||||
|
'currency': "[{$gtmCurrency->name}]",
|
||||||
|
'value': [{$d3BasketPrice->getPrice()}],
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'items':
|
||||||
|
[
|
||||||
|
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||||
|
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
||||||
|
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||||
|
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||||
|
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||||
|
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||||
|
[{if $gtmBasketItemCategory}]
|
||||||
|
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'quantity': [{$basketitem->getAmount()}],
|
||||||
|
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||||
|
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_begin_checkout}]
|
||||||
|
[{/block}]
|
56
Application/views/event/purchase.tpl
Normal file
56
Application/views/event/purchase.tpl
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
[{block name="d3_ga4_purchase_block"}]
|
||||||
|
[{capture name="d3_ga4_purchase"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
[{assign var="gtmOrder" value=$oView->getOrder()}]
|
||||||
|
[{assign var="gtmBasket" value=$oView->getBasket()}]
|
||||||
|
[{assign var="gtmArticles" value=$gtmOrder->getOrderArticles()}]
|
||||||
|
[{assign var="gtmOrderVouchers" value=$gtmOrder->getVoucherNrList()}]
|
||||||
|
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'purchase',
|
||||||
|
'eventLabel':'Checkout Step 5',
|
||||||
|
'ecommerce':
|
||||||
|
{
|
||||||
|
'transaction_id': '[{$gtmOrder->getFieldData("oxordernr")}]',
|
||||||
|
'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]',
|
||||||
|
'value': [{$gtmOrder->getTotalOrderSum()}],
|
||||||
|
'tax': [{math equation="x+y" x=$gtmOrder->getFieldData("oxartvatprice1") y=$gtmOrder->getFieldData("oxartvatprice2") }],
|
||||||
|
'shipping': [{$gtmOrder->getFieldData("oxdelcost")}],
|
||||||
|
'currency': '[{$gtmOrder->getFieldData('oxcurrency')}]',
|
||||||
|
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
||||||
|
'paymentType': '[{$gtmBasket->getPaymentOnPaymentId()}]',
|
||||||
|
'items':
|
||||||
|
[
|
||||||
|
[{foreach from=$gtmArticles item="gtmBasketItem" name="gtmArticles"}]
|
||||||
|
[{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}]
|
||||||
|
[{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}]
|
||||||
|
[{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}]
|
||||||
|
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]',
|
||||||
|
'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
||||||
|
'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
||||||
|
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
||||||
|
'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]',
|
||||||
|
[{if $gtmPurchaseItemCategory}]
|
||||||
|
'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmPurchaseItemPriceObject->getPrice()}],[{/oxhasrights}]
|
||||||
|
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
|
||||||
|
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
||||||
|
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
})
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_purchase}]
|
||||||
|
[{/block}]
|
46
Application/views/event/remove_from_cart.tpl
Normal file
46
Application/views/event/remove_from_cart.tpl
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
[{block name="d3_ga4_remove_from_cart_block"}]
|
||||||
|
[{if $hasBeenReloaded}]
|
||||||
|
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||||
|
[{capture name="d3_ga4_remove_from_cart"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'isRemoveFromCart': true,
|
||||||
|
'event': 'remove_from_cart',
|
||||||
|
'eventLabel':'remove_from_cart',
|
||||||
|
'ecommerce': {
|
||||||
|
'actionField': "step: 1",
|
||||||
|
'currency': "[{$currency->name}]",
|
||||||
|
'value': [{$d3BasketPrice->getPrice()}],
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'items': [
|
||||||
|
[{foreach from=$toRemoveArticles->getArray() name=gtmRemovedItems item=rmItem key=rmItemindex}]
|
||||||
|
[{assign var="d3oItemPrice" value=$rmItem->getPrice()}]
|
||||||
|
[{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}]
|
||||||
|
{
|
||||||
|
'item_id': '[{$rmItem->getFieldData('oxartnum')}]',
|
||||||
|
'item_name': '[{$rmItem->getFieldData('oxtitle')}]',
|
||||||
|
'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]',
|
||||||
|
[{if $gtmBasketItemCategory}]
|
||||||
|
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
|
||||||
|
'position': [{$smarty.foreach.gtmRemovedItems.index}]
|
||||||
|
}[{if !$smarty.foreach.gtmRemovedItems.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_remove_from_cart}]
|
||||||
|
[{/if}]
|
||||||
|
[{/block}]
|
50
Application/views/event/view_cart.tpl
Normal file
50
Application/views/event/view_cart.tpl
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||||
|
|
||||||
|
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||||
|
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
||||||
|
|
||||||
|
[{block name="d3_ga4_view_cart_block"}]
|
||||||
|
[{capture name="d3_ga4_view_cart"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'view_cart',
|
||||||
|
'eventLabel':'Checkout Step 1',
|
||||||
|
'ecommerce':
|
||||||
|
{
|
||||||
|
'actionField': "step: 1",
|
||||||
|
'currency': "[{$currency->name}]",
|
||||||
|
'value': [{$d3BasketPrice->getPrice()}],
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'items':
|
||||||
|
[
|
||||||
|
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||||
|
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
||||||
|
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||||
|
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||||
|
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||||
|
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||||
|
[{if $gtmBasketItemCategory}]
|
||||||
|
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||||
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
|
'quantity': [{$basketitem->getAmount()}],
|
||||||
|
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||||
|
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_view_cart}]
|
||||||
|
[{/block}]
|
40
Application/views/event/view_item.tpl
Normal file
40
Application/views/event/view_item.tpl
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
||||||
|
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||||
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
|
|
||||||
|
[{block name="d3_ga4_view_item_block"}]
|
||||||
|
[{capture name="d3_ga4_view_item"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'view_item',
|
||||||
|
'eventLabel':'Product View',
|
||||||
|
'ecommerce':
|
||||||
|
{
|
||||||
|
'currency': '[{$currency->name}]',
|
||||||
|
'items':
|
||||||
|
[
|
||||||
|
{
|
||||||
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
|
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
|
||||||
|
[{if $gtmCategory}]
|
||||||
|
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}][{/oxhasrights}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
|
||||||
|
[{/block}]
|
@ -1,46 +1,45 @@
|
|||||||
[{$smarty.block.parent}]
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
|
||||||
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
|
|
||||||
|
[{assign var="breadCrumb" value=''}]
|
||||||
[{assign var="breadCrumb" value=''}]
|
|
||||||
|
[{block name="d3_ga4_view_item_list_block"}]
|
||||||
[{block name="d3_ga4_view_item_list_block"}]
|
[{if $gtmProducts|@count}]
|
||||||
[{if $gtmProducts|@count}]
|
[{capture name="d3_ga4_view_item_list"}]
|
||||||
[{capture assign=d3_ga4_view_item_list}]
|
[{strip}]
|
||||||
[{strip}]
|
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")}]',
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||||
'price': [{$d3PriceObject->getPrice()}],
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
[{if $gtmCategory}]
|
||||||
[{if $gtmCategory}]
|
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
|
||||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
[{/if}]
|
||||||
[{/if}]
|
'quantity': 1
|
||||||
'quantity': 1
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
[{/foreach}]
|
||||||
[{/foreach}]
|
]
|
||||||
]
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
}[{if $oViewConf->isDebugModeOn()}],
|
'debug_mode': 'true'
|
||||||
'debug_mode': 'true'
|
[{/if}]
|
||||||
[{/if}]
|
});
|
||||||
});
|
[{/strip}]
|
||||||
[{/strip}]
|
[{/capture}]
|
||||||
[{/capture}]
|
[{oxscript add=$smarty.capture.d3_ga4_view_item_list}]
|
||||||
[{oxscript add=$d3_ga4_view_item_list}]
|
[{/if}]
|
||||||
[{/if}]
|
|
||||||
[{/block}]
|
[{/block}]
|
44
Application/views/event/view_search_result.tpl
Normal file
44
Application/views/event/view_search_result.tpl
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||||
|
|
||||||
|
[{block name="d3_ga4_view_search_result_block"}]
|
||||||
|
[{if $gtmProducts}]
|
||||||
|
[{capture name="d3_ga4_view_search_result"}]
|
||||||
|
[{strip}]
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'view_search_result',
|
||||||
|
'eventLabel':'view_search_result[{if $oViewConf->isDebugModeOn()}]_test[{/if}]',
|
||||||
|
'ecommerce': {
|
||||||
|
'search_term': '[{$searchparamforhtml}]',
|
||||||
|
'items': [
|
||||||
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||||
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||||
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
|
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||||
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
|
[{if $gtmCategory}]
|
||||||
|
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
|
||||||
|
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||||
|
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||||
|
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||||
|
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||||
|
[{/if}]
|
||||||
|
'quantity': 1
|
||||||
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}[{if $oViewConf->isDebugModeOn()}],
|
||||||
|
'debug_mode': 'true'
|
||||||
|
[{/if}]
|
||||||
|
});
|
||||||
|
[{/strip}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$smarty.capture.d3_ga4_view_search_result}]
|
||||||
|
[{/if}]
|
||||||
|
[{/block}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,52 +0,0 @@
|
|||||||
[{$smarty.block.parent}]
|
|
||||||
|
|
||||||
[{* variable $gtmProduct is passed from parent tempalte *}]
|
|
||||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
|
||||||
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
|
|
||||||
[{block name="d3_ga4_add_to_cart_block"}]
|
|
||||||
[{capture assign=d3_ga4_add_to_cart}]
|
|
||||||
[{strip}]
|
|
||||||
$("#toBasket").click(function(event) {
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
|
|
||||||
[{*** Debug cases ***}]
|
|
||||||
[{*event.preventDefault();*}]
|
|
||||||
|
|
||||||
let iArtQuantity = $("#amountToBasket").val();
|
|
||||||
|
|
||||||
dataLayer.push({
|
|
||||||
'isAddToBasket': true,
|
|
||||||
'event':'add_to_cart',
|
|
||||||
'eventLabel': 'add_to_cart',
|
|
||||||
'ecommerce': {
|
|
||||||
'currency': "[{$currency->name}]",
|
|
||||||
'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
|
|
||||||
'items': [
|
|
||||||
{
|
|
||||||
'item_id': '[{$gtmProduct->getFieldData('oxartnum')}]',
|
|
||||||
'item_name': '[{$gtmProduct->getFieldData('oxtitle')}]',
|
|
||||||
'price': [{$d3PriceObject->getPrice()}],
|
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'item_variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]',
|
|
||||||
[{if $gtmCategory}]
|
|
||||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
|
||||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
|
||||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
|
||||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
|
||||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
|
||||||
[{/if}]
|
|
||||||
'quantity': iArtQuantity
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}[{if $oViewConf->isDebugModeOn()}],
|
|
||||||
'debug_mode': 'true'
|
|
||||||
[{/if}]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
[{/strip}]
|
|
||||||
[{/capture}]
|
|
||||||
[{oxscript add=$d3_ga4_add_to_cart}]
|
|
||||||
[{/block}]
|
|
@ -30,7 +30,7 @@
|
|||||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]',
|
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]',
|
||||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||||
[{/if}]
|
[{/if}]
|
||||||
'price': [{$d3oItemPrice->getPrice()}],
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||||
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
|
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
|
||||||
'position': [{$smarty.foreach.gtmRemovedItems.index}]
|
'position': [{$smarty.foreach.gtmRemovedItems.index}]
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||||
|
|
||||||
[{block name="d3_ga4_view_search_result_block"}]
|
[{block name="d3_ga4_view_search_result_block"}]
|
||||||
[{if $gtmProducts|@count}]
|
[{if $gtmProducts}]
|
||||||
[{capture assign=d3_ga4_view_search_result}]
|
[{capture assign=d3_ga4_view_search_result}]
|
||||||
[{strip}]
|
[{strip}]
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
@ -20,7 +20,7 @@
|
|||||||
{
|
{
|
||||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
'price': [{$d3PriceObject->getPrice()}],
|
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
[{if $gtmCategory}]
|
[{if $gtmCategory}]
|
||||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
||||||
|
18
Application/views/tpl/page/account/d3gtmnoticelist.tpl
Normal file
18
Application/views/tpl/page/account/d3gtmnoticelist.tpl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[{capture append="oxidBlock_content"}]
|
||||||
|
[{assign var="template_title" value="MY_WISH_LIST"|oxmultilangassign}]
|
||||||
|
<h1 class="page-header">[{oxmultilang ident="MY_WISH_LIST"}]</h1>
|
||||||
|
|
||||||
|
[{if $oView->getNoticeProductList()}]
|
||||||
|
[{include file="widget/product/list.tpl" type="line" listId="noticelistProductList" title="" products=$oView->getNoticeProductList() removeFunction="tonoticelist" owishid=$oxcmp_user->oxuser__oxid->value}]
|
||||||
|
[{else}]
|
||||||
|
<p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p>
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
||||||
|
|
||||||
|
[{insert name="oxid_tracker" title=$template_title}]
|
||||||
|
[{/capture}]
|
||||||
|
[{capture append="oxidBlock_sidebar"}]
|
||||||
|
[{include file="page/account/inc/account_menu.tpl" active_link="noticelist"}]
|
||||||
|
[{/capture}]
|
||||||
|
[{include file="layout/page.tpl" sidebar="Left"}]
|
@ -0,0 +1,32 @@
|
|||||||
|
[{capture append="oxidBlock_content"}]
|
||||||
|
[{assign var="template_title" value="LISTMANIA"|oxmultilangassign}]
|
||||||
|
[{assign var="_actvrecommlist" value=$oView->getActiveRecommList()}]
|
||||||
|
|
||||||
|
<h1 class="page-header">[{oxmultilang ident="LISTMANIA"}]</h1>
|
||||||
|
|
||||||
|
[{if $oView->isSavedList()}]
|
||||||
|
[{assign var="_statusMessage" value="LISTMANIA_LIST_SAVED"|oxmultilangassign}]
|
||||||
|
[{include file="message/success.tpl" statusMessage=$_statusMessage}]
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
[{block name="account_redommendationlist_content"}]
|
||||||
|
|
||||||
|
[{include file="form/recommendation_edit.tpl" actvrecommlist=$_actvrecommlist}]
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
[{if !$oView->getActiveRecommList()}]
|
||||||
|
[{assign var="blEdit" value=true}]
|
||||||
|
[{include file="page/recommendations/inc/list.tpl"}]
|
||||||
|
[{/if}]
|
||||||
|
[{/block}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
||||||
|
|
||||||
|
[{insert name="oxid_tracker" title=$template_title}]
|
||||||
|
[{/capture}]
|
||||||
|
[{capture append="oxidBlock_sidebar"}]
|
||||||
|
[{include file="page/account/inc/account_menu.tpl" active_link="recommendationlist"}]
|
||||||
|
[{/capture}]
|
||||||
|
[{include file="layout/page.tpl" sidebar="Left"}]
|
||||||
|
|
44
Application/views/tpl/page/account/d3gtmwishlist.tpl
Normal file
44
Application/views/tpl/page/account/d3gtmwishlist.tpl
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
[{capture append="oxidBlock_content"}]
|
||||||
|
[{assign var="template_title" value="MY_GIFT_REGISTRY"|oxmultilangassign}]
|
||||||
|
[{if !$oView->getWishListUsers() && $oView->getWishListSearchParam()}]
|
||||||
|
[{assign var="_statusMessage" value="MESSAGE_SORRY_NO_GIFT_REGISTRY"|oxmultilangassign}]
|
||||||
|
[{include file="message/error.tpl" statusMessage=$_statusMessage}]
|
||||||
|
[{/if}]
|
||||||
|
[{assign var="editval" value=$oView->getEnteredData()}]
|
||||||
|
[{if $oView->isWishListEmailSent()}]
|
||||||
|
[{assign var="_statusMessage" value="GIFT_REGISTRY_SENT_SUCCESSFULLY"|oxmultilangassign:$editval->rec_email}]
|
||||||
|
[{include file="message/notice.tpl" statusMessage=$_statusMessage}]
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
<h1 class="page-header">[{$oView->getTitle()}]</h1>
|
||||||
|
|
||||||
|
<div class="wishlist-search">
|
||||||
|
[{include file="form/wishlist_search.tpl" searchClass="account_wishlist"}]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="wishlist">
|
||||||
|
[{if $oView->getWishList()}]
|
||||||
|
[{include file="form/wishlist_publish.tpl"}]
|
||||||
|
<hr>
|
||||||
|
[{include file="form/wishlist_suggest.tpl"}]
|
||||||
|
[{/if}]
|
||||||
|
</div>
|
||||||
|
|
||||||
|
[{if $oView->getWishList()}]
|
||||||
|
[{include file="widget/product/list.tpl" type="line" listId="wishlistProductList" title="" products=$oView->getWishProductList() removeFunction="towishlist" toBasketFunction="tobasket" owishid=$oxcmp_user->oxuser__oxid->value}]
|
||||||
|
[{else}]
|
||||||
|
<p class="alert alert-info">
|
||||||
|
[{oxmultilang ident="GIFT_REGISTRY_EMPTY"}]
|
||||||
|
</p>
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
|
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
||||||
|
|
||||||
|
[{insert name="oxid_tracker" title=$template_title}]
|
||||||
|
[{/capture}]
|
||||||
|
[{capture append="oxidBlock_sidebar"}]
|
||||||
|
[{include file="page/account/inc/account_menu.tpl" active_link="wishlist"}]
|
||||||
|
[{/capture}]
|
||||||
|
[{include file="layout/page.tpl" sidebar="Left"}]
|
259
CHANGELOG.md
259
CHANGELOG.md
@ -4,6 +4,265 @@ 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).
|
||||||
|
|
||||||
|
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.2...rel_2.x) - 2025-x
|
||||||
|
### Added
|
||||||
|
- data layer doesn't contain prices if current user hasn't "show price" rights
|
||||||
|
|
||||||
|
## [2.23.0.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...2.23.0.2) - 2025-03-19
|
||||||
|
### Fixed
|
||||||
|
- unwanted reste of chosen CMP in admin
|
||||||
|
- over-engineered method construct
|
||||||
|
|
||||||
|
## [2.23.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.0...2.23.0.1) - 2025-02-19
|
||||||
|
### Fixed
|
||||||
|
- false metadata view_cart entry
|
||||||
|
- missing menu-translation
|
||||||
|
|
||||||
|
## [2.23.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...2.23.0.0) - 2024-12-21
|
||||||
|
### Added
|
||||||
|
- another tag-versioning position
|
||||||
|
- additional global variables, if given
|
||||||
|
|
||||||
|
## [2.22.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.21.0...2.22.0) - 2024-09-21
|
||||||
|
### Fixed
|
||||||
|
- Consentmanager didn't get delivered
|
||||||
|
### Changed
|
||||||
|
- write "internal_names" of CMP to constants
|
||||||
|
|
||||||
|
## [2.21.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.1...2.21.0) - 2024-09-19
|
||||||
|
### Fixed
|
||||||
|
- missing parameters for widget.php call
|
||||||
|
|
||||||
|
## [2.20.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.0...2.20.1) - 2024-09-11
|
||||||
|
### Fixed
|
||||||
|
- missing currency name in begin_checkout template
|
||||||
|
## [2.20.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.19.0...2.20.0) - 2024-08-20
|
||||||
|
### Added
|
||||||
|
- new event "begin_checkout"
|
||||||
|
- new event "add_payment_info"
|
||||||
|
|
||||||
|
## [2.19.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.2...2.19.0) - 2024-08-10
|
||||||
|
### Fixed
|
||||||
|
- usage of not yet existing function
|
||||||
|
|
||||||
|
## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.1...2.18.2) - 2024-06-25
|
||||||
|
### Fixed
|
||||||
|
- oe-console apply-configuration triggers on-activate and overwrites existing values
|
||||||
|
|
||||||
|
## [2.18.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-04
|
||||||
|
### Fixed
|
||||||
|
- missing return statement, on null/ none
|
||||||
|
|
||||||
|
## [2.18.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...2.18.0) - 2024-06-03
|
||||||
|
### Added
|
||||||
|
- trait for generalized method
|
||||||
|
- new admin UI
|
||||||
|
- additional check for properly activated module
|
||||||
|
- admin headitem alternative
|
||||||
|
- usercentrips step/ option 2
|
||||||
|
- group CMP-Functionalities/ properties into own Model
|
||||||
|
- additional help texts, translations, explanations
|
||||||
|
- extended docs
|
||||||
|
- auto safe on first approach ga4 + cmp-mod
|
||||||
|
- onActivate/ onDeactivate
|
||||||
|
## Changed
|
||||||
|
- declare module settings consistency
|
||||||
|
- configParamGetter
|
||||||
|
- clear dead code
|
||||||
|
- template code upgrade
|
||||||
|
- lang text
|
||||||
|
- amount of save-buttons
|
||||||
|
- Usercentrics-Class constants and adjust global-module-code to it
|
||||||
|
- CMP-output in tpl
|
||||||
|
- clear code and adjust Naming
|
||||||
|
## Fixed
|
||||||
|
- false class-property declaration
|
||||||
|
- wrong to-save param
|
||||||
|
## Removed
|
||||||
|
- deprecated and obsolete module-settings
|
||||||
|
- false composer xml-excludation
|
||||||
|
|
||||||
|
## [2.17.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.1...2.17.2) - 2024-04-11
|
||||||
|
### Fixed
|
||||||
|
- error on missing necessary-component
|
||||||
|
|
||||||
|
## [2.17.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.0...2.17.1) - 2024-04-10
|
||||||
|
### Fixed
|
||||||
|
- second call of getGtmContainerId() ( returned false )
|
||||||
|
|
||||||
|
## [2.17.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.16.0...2.17.0) - 2024-04-10
|
||||||
|
### Added
|
||||||
|
- Google-Analytics default values
|
||||||
|
- default values switch ( admin module settings )
|
||||||
|
- translations
|
||||||
|
## Changed
|
||||||
|
- centralized metadata-id
|
||||||
|
|
||||||
|
## [2.16.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.15.0...2.16.0) - 2024-03-20
|
||||||
|
### Added
|
||||||
|
- ( Google ) Server-Side tagging usability
|
||||||
|
|
||||||
|
## [2.15.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.14.0...2.15.0) - 2024-02-05
|
||||||
|
### Fixed
|
||||||
|
- missing Component-ArticleDetails extension, missing ManufacturerListController extension
|
||||||
|
|
||||||
|
## [2.14.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.13.1...2.14.0) - 2023-01-22
|
||||||
|
### Added
|
||||||
|
- add_to_cart Event to several new shop-pages (landing-page, Account, category article-list, start)
|
||||||
|
- PHPStan code-cleanup
|
||||||
|
### Changed
|
||||||
|
- template structure
|
||||||
|
- code cleanup
|
||||||
|
|
||||||
|
## [2.13.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.13.0...2.13.1) - 2023-01-03
|
||||||
|
### Fixed
|
||||||
|
- error on array-count at zero entries
|
||||||
|
|
||||||
|
## [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
|
||||||
|
|
||||||
|
## [2.11.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.10.1...2.11.0) - 2023-08-23
|
||||||
|
### Added
|
||||||
|
- manufacturer extension
|
||||||
|
- working debug_mode
|
||||||
|
### Changed
|
||||||
|
- check for 'article has been removed'
|
||||||
|
- general template cleanup
|
||||||
|
|
||||||
|
## [2.10.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.10.0...2.10.1) - 2023-08-03
|
||||||
|
### Added
|
||||||
|
- missing param to identify the event
|
||||||
|
|
||||||
|
## [2.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.2...2.10.0) - 2023-08-02
|
||||||
|
### Added
|
||||||
|
- new Event "remove_from_cart"
|
||||||
|
|
||||||
|
## [2.9.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.1...2.9.2) - 2023-06-29
|
||||||
|
### Fixed
|
||||||
|
- wrong variable for category-object check
|
||||||
|
|
||||||
|
## [2.9.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.0...2.9.1) - 2023-06-27
|
||||||
|
### Fixed
|
||||||
|
- deny method call on no category
|
||||||
|
|
||||||
|
## [2.9.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.8.0...2.9.0) - 2023-06-27
|
||||||
|
### Added
|
||||||
|
- Cookiefirst usability
|
||||||
|
|
||||||
|
## [2.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.7.0...2.8.0) - 2023-06-23
|
||||||
|
### Added
|
||||||
|
- Method to get the in order used Payment-Name
|
||||||
|
- Method to get the current Article Category
|
||||||
|
- Following Entries to dedicated event-templates
|
||||||
|
- coupon
|
||||||
|
- paymentType
|
||||||
|
- item_list_name
|
||||||
|
- item_category
|
||||||
|
### Changed
|
||||||
|
- all used template-files have a more dedicated name
|
||||||
|
- general code cleanup
|
||||||
|
|
||||||
|
## [2.7.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.6.0...2.7.0) - 2023-06-19
|
||||||
|
### Changed
|
||||||
|
- 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.17.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.16.0...1.17.0) - 2024-04-11
|
||||||
|
### Added
|
||||||
|
- multilang translations
|
||||||
|
- GA4 consent-mode default values
|
||||||
|
### Changed
|
||||||
|
- metadataID centralized
|
||||||
|
|
||||||
|
## [1.16.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.15.1...1.16.0) - 2024-04-11
|
||||||
|
### Added
|
||||||
|
- ( Google ) Server-Side tagging usability
|
||||||
|
|
||||||
|
## [1.15.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.14.0...1.15.0) - 2024-01-25
|
||||||
|
### Fixed
|
||||||
|
- missing Component-ArticleDetails extension, missing ManufacturerListController extension
|
||||||
|
|
||||||
|
## [1.14.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.13.0...1.14.0) - 2024-01-03
|
||||||
|
### Added
|
||||||
|
- add_to_cart Event to several new shop-pages (landing-page, Account, category article-list, start)
|
||||||
|
- PHPStan code-cleanup
|
||||||
|
### Changed
|
||||||
|
- template structure
|
||||||
|
- code cleanup
|
||||||
|
|
||||||
## [1.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.12.0...1.13.0) - 2023-09-13
|
## [1.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.12.0...1.13.0) - 2023-09-13
|
||||||
### Added
|
### Added
|
||||||
- extended Docs
|
- extended Docs
|
||||||
|
@ -1,47 +1,23 @@
|
|||||||
# Technische Doku
|
# Technische Doku
|
||||||
## GA4 Events / Customizing
|
## GA4 Events / Customizing
|
||||||
FĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/d3/googleanalytics4/Application/views/ga4/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
|
FĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/d3/googleanalytics4/Application/views/event/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
|
||||||
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/d3/googleanalytics4/Application/views/blocks/`.
|
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/d3/googleanalytics4/Application/views/blocks/`.
|
||||||
*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/
|
||||||
|
|
||||||
|
## Container-ID
|
||||||
|
Diese finden Sie im "Google-Tag-Manager"-Arbeitsbereich in der Navigationsleiste.
|
||||||
|
Sie beginnt mit GTM, gefolgt von einem Bindestrich und einer Zeichenkette.
|
||||||
|
|
||||||
|
Diese ID wird benötigt, um Google anzuweise, zu welchem "Google Tag Manager"-Arbeitsbereich die
|
||||||
|
gesammelten Daten im Daten-Stream geleitet werden sollen.
|
||||||
|
|
||||||
## Steuerungsparameter
|
## Steuerungsparameter
|
||||||
Tragen Sie hier im Normalfall die ID des zu prĂĽfenden Cookies ein.
|
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
|
In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt
|
||||||
nach der gewählten CMP (Consent Manager Platform).
|
nach der gewählten CMP (Consent Manager Platform).
|
||||||
|
|
||||||
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
|
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
|
||||||
|
|
||||||
## Blöcke
|
|
||||||
Für den geregelten Ablauf sind folgende Blöcke nötig:
|
|
||||||
- Suchergebnisse
|
|
||||||
- Blockname: search_results
|
|
||||||
- Datei: page/search/search.tpl
|
|
||||||
- GA4 Event: view_search_results
|
|
||||||
- Artikelliste
|
|
||||||
- Blockname: page_list_productlist
|
|
||||||
- Datei: page/list/list.tpl
|
|
||||||
- GA4 Event: view_item_list
|
|
||||||
- Detailseite
|
|
||||||
- Blockname: details_productmain_title
|
|
||||||
- Datei: page/details/inc/productmain.tpl
|
|
||||||
- GA4 Event: view_item
|
|
||||||
- dem WK hinzufĂĽgen (button)
|
|
||||||
- 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
|
|
||||||
- GA4 Event: view_cart
|
|
||||||
- abgeschlossener Kauf
|
|
||||||
- Blockname: checkout_thankyou_main
|
|
||||||
- Datei: page/checkout/thankyou.tpl
|
|
||||||
- GA4 Event: purchase
|
|
||||||
|
|
||||||
## VerfĂĽgbare Datalayer Variablen
|
## VerfĂĽgbare Datalayer Variablen
|
||||||
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
||||||
@ -80,7 +56,7 @@ Aktivieren Sie anschlieĂźend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
|||||||
- 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
|
Google Tag Manager eintragen
|
||||||
-
|
|
||||||
- [Consent Management Provider](https://www.consentmanager.net/)
|
- [Consent Management Provider](https://www.consentmanager.net/)
|
||||||
- In der Consentmanager-Oberfläche den Anbieter "Google Tag Manager" mit der ID s905 hinzufügen
|
- 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
|
- Im Frontend, im consentmanager-Pop-up nach dem 'Google Tag Manager' suchen
|
||||||
@ -88,6 +64,9 @@ 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)
|
- [Cookiefirst](https://cookiefirst.com)
|
||||||
- Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite.
|
- im Cookiefirst-Hub das jeweilige Cookie finden underen zugeordnete Kategorie kopieren
|
||||||
|
- die kopierte Kategory wird nun in den Einstellungen des Moduls hinterlegt:
|
||||||
|
```Erweiterungen > Module > Google Analytics 4 > Einstell. > Cookie Manager Einstellungen > Steuerungsparameter (vormals CookieID)```
|
||||||
|
- **Wichtig!** bei Nutzung des Consent-Managers von Google, muss zwangsläufig die Einstellung "Cookie manager Nutzen?" __ausgeschalten!__ werden
|
@ -18,11 +18,56 @@ namespace D3\GoogleAnalytics4\Modules\Core{
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Model\Payment;
|
||||||
|
|
||||||
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
|
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
|
||||||
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
||||||
|
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {}
|
||||||
|
|
||||||
|
class gtmPayment_parent extends Payment {}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Controller\AccountNoticeListController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\AccountRecommlistController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\AccountWishlistController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\Admin\ManufacturerController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\ArticleListController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\SearchController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\StartController;
|
||||||
|
|
||||||
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 {}
|
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
|
||||||
|
|
||||||
|
class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController {}
|
||||||
|
|
||||||
|
class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController {}
|
||||||
|
|
||||||
|
class d3GtmAccountNoticeListController_parent extends AccountNoticeListController {}
|
||||||
|
|
||||||
|
class d3GtmAccountRecommlistController_parent extends AccountRecommlistController {}
|
||||||
|
|
||||||
|
class d3GtmAccountWishlistController_parent extends AccountWishlistController {}
|
||||||
|
|
||||||
|
class d3GtmStartController_parent extends StartController {}
|
||||||
|
|
||||||
|
class d3GtmSearchController_parent extends SearchController {}
|
||||||
|
|
||||||
|
class d3GtmManufacturerListController_parent extends ManufacturerController {}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Component{
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Component\BasketComponent;
|
||||||
|
|
||||||
|
class d3GtmBasketComponentExtension_parent extends BasketComponent {}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails;
|
||||||
|
|
||||||
|
class d3GtmWidgetArticleDetails_parent extends ArticleDetails {}
|
||||||
}
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget;
|
||||||
|
|
||||||
|
|
||||||
|
class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Component;
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Model\Article;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
|
class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param $sProductId
|
||||||
|
* @param $dAmount
|
||||||
|
* @param $aSel
|
||||||
|
* @param $aPersParam
|
||||||
|
* @param $blOverride
|
||||||
|
* @return mixed|string
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function toBasket($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false)
|
||||||
|
{
|
||||||
|
$return = parent::toBasket($sProductId, $dAmount, $aSel, $aPersParam, $blOverride);
|
||||||
|
|
||||||
|
Registry::getSession()->setVariable('d3GtmAddToBasketTrigger', true);
|
||||||
|
|
||||||
|
$iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am');
|
||||||
|
|
||||||
|
if ($iAmountArticlesAddedToCart){
|
||||||
|
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart);
|
||||||
|
}else{
|
||||||
|
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getD3GtmAddToCartAmountArticles() :int
|
||||||
|
{
|
||||||
|
$iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles');
|
||||||
|
|
||||||
|
Registry::getSession()->deleteVariable('d3GtmAddToCartAmountArticles');
|
||||||
|
|
||||||
|
return (int) $iAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getAddToBasketDecision() :bool
|
||||||
|
{
|
||||||
|
$decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger');
|
||||||
|
|
||||||
|
Registry::getSession()->setVariable('d3GtmAddToBasketTrigger', false);
|
||||||
|
|
||||||
|
return (bool) $decision;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Article|null
|
||||||
|
*/
|
||||||
|
public function d3GtmRequestedArticleLoadedByAnid()
|
||||||
|
{
|
||||||
|
$sAnid = Registry::getRequest()->getRequestEscapedParameter('anid');
|
||||||
|
|
||||||
|
$oArticle = null;
|
||||||
|
|
||||||
|
if ($sAnid){
|
||||||
|
/** @var Article $oArticle */
|
||||||
|
$oArticle = oxNew(Article::class);
|
||||||
|
$oArticle->load($sAnid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $oArticle;
|
||||||
|
}
|
||||||
|
}
|
15
Modules/Application/Controller/ArticleDetailsController.php
Normal file
15
Modules/Application/Controller/ArticleDetailsController.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
class ArticleDetailsController extends ArticleDetailsController_parent
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
class ArticleListController_AddToCartHelpMethods extends ArticleListController_AddToCartHelpMethods_parent
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$render = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $render;
|
||||||
|
}
|
||||||
|
}
|
@ -11,7 +11,7 @@ use oxSystemComponentException;
|
|||||||
class BasketController extends BasketController_parent
|
class BasketController extends BasketController_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @throws oxSystemComponentException
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
@ -33,22 +33,18 @@ class BasketController extends BasketController_parent
|
|||||||
$aProducts = Registry::getRequest()->getRequestEscapedParameter('aproducts');
|
$aProducts = Registry::getRequest()->getRequestEscapedParameter('aproducts');
|
||||||
|
|
||||||
// collecting specified item
|
// collecting specified item
|
||||||
$sProductId = $sProductId ?? Registry::getRequest()->getRequestEscapedParameter('aid');
|
$sProductId = Registry::getRequest()->getRequestEscapedParameter('aid');
|
||||||
if ($sProductId) {
|
if ($sProductId) {
|
||||||
// additionally fetching current product info
|
// additionally fetching current product info
|
||||||
$dAmount = $dAmount ?? Registry::getRequest()->getRequestEscapedParameter('am');
|
$dAmount = Registry::getRequest()->getRequestEscapedParameter('am');
|
||||||
|
|
||||||
// select lists
|
// select lists
|
||||||
$aSel = $aSel ?? Registry::getRequest()->getRequestEscapedParameter('sel');
|
$aSel = Registry::getRequest()->getRequestEscapedParameter('sel');
|
||||||
|
|
||||||
// persistent parameters
|
/** @var BasketComponent $oBasketComponent */
|
||||||
if (empty($aPersParam)) {
|
$oBasketComponent = $this->getComponent('oxcmp_basket');
|
||||||
|
|
||||||
/** @var BasketComponent $oBasketComponent */
|
$aPersParam = $oBasketComponent->__call('getPersistedParameters', []);
|
||||||
$oBasketComponent = $this->getComponent('oxcmp_basket');
|
|
||||||
|
|
||||||
$aPersParam = $oBasketComponent->__call('getPersistedParameters', []);
|
|
||||||
}
|
|
||||||
|
|
||||||
$sBasketItemId = Registry::getRequest()->getRequestEscapedParameter('bindex');
|
$sBasketItemId = Registry::getRequest()->getRequestEscapedParameter('bindex');
|
||||||
|
|
||||||
@ -124,4 +120,4 @@ class BasketController extends BasketController_parent
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\Country;
|
use OxidEsales\Eshop\Application\Model\Country;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Order;
|
||||||
|
|
||||||
class ThankYouController extends ThankYouController_parent
|
class ThankYouController extends ThankYouController_parent
|
||||||
{
|
{
|
||||||
@ -11,7 +12,9 @@ class ThankYouController extends ThankYouController_parent
|
|||||||
*/
|
*/
|
||||||
public function d3GAGetUserCountry()
|
public function d3GAGetUserCountry()
|
||||||
{
|
{
|
||||||
$sCountryId = $this->getOrder()->getFieldData('oxbillcountryid');
|
/** @var Order $oOrder */
|
||||||
|
$oOrder = $this->getOrder();
|
||||||
|
$sCountryId = $oOrder->getFieldData('oxbillcountryid');
|
||||||
|
|
||||||
/** @var Country $oCountry */
|
/** @var Country $oCountry */
|
||||||
$oCountry = oxNew(Country::class);
|
$oCountry = oxNew(Country::class);
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent
|
||||||
|
{
|
||||||
|
protected $_sThisTemplate = 'page/account/d3gtmnoticelist.tpl';
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent
|
||||||
|
{
|
||||||
|
protected $_sThisTemplate = 'page/account/d3gtmrecommendationlist.tpl';
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent
|
||||||
|
{
|
||||||
|
protected $_sThisTemplate = 'page/account/d3gtmwishlist.tpl';
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
|
||||||
|
class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
23
Modules/Application/Controller/d3GtmSearchController.php
Normal file
23
Modules/Application/Controller/d3GtmSearchController.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
|
||||||
|
class d3GtmSearchController extends d3GtmSearchController_parent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
if (false === in_array('oxcmp_basket', $this->getComponents())){
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
19
Modules/Application/Controller/d3GtmStartController.php
Normal file
19
Modules/Application/Controller/d3GtmStartController.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||||
|
|
||||||
|
class d3GtmStartController extends d3GtmStartController_parent
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$return = parent::render();
|
||||||
|
|
||||||
|
if (false === in_array('oxcmp_basket', $this->getComponents())){
|
||||||
|
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
@ -7,7 +7,7 @@ use OxidEsales\Eshop\Application\Model\Payment;
|
|||||||
class Basket extends Basket_parent
|
class Basket extends Basket_parent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getPaymentOnPaymentId() :string
|
public function getPaymentOnPaymentId() :string
|
||||||
{
|
{
|
||||||
|
@ -4,41 +4,5 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
|||||||
|
|
||||||
class Category extends Category_parent
|
class Category extends Category_parent
|
||||||
{
|
{
|
||||||
/**
|
use articleTreeStructure;
|
||||||
* @param int $indexOfArray
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getSplitCategoryArray(int $indexOfArray = -1) :string
|
|
||||||
{
|
|
||||||
if ($indexOfArray > -1){
|
|
||||||
$splitCatArray =
|
|
||||||
array_values(
|
|
||||||
array_filter(
|
|
||||||
explode(
|
|
||||||
'/',
|
|
||||||
trim(
|
|
||||||
parse_url(
|
|
||||||
$this->getLink(),
|
|
||||||
5
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($splitCatArray[$indexOfArray]){
|
|
||||||
return $splitCatArray[$indexOfArray];
|
|
||||||
}else{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
trim(
|
|
||||||
parse_url(
|
|
||||||
$this->getLink(),
|
|
||||||
5
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -4,41 +4,5 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
|||||||
|
|
||||||
class Manufacturer extends Manufacturer_parent
|
class Manufacturer extends Manufacturer_parent
|
||||||
{
|
{
|
||||||
/**
|
use articleTreeStructure;
|
||||||
* @param int $indexOfArray
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getSplitCategoryArray(int $indexOfArray = -1) :string
|
|
||||||
{
|
|
||||||
if ($indexOfArray > -1){
|
|
||||||
$splitCatArray =
|
|
||||||
array_values(
|
|
||||||
array_filter(
|
|
||||||
explode(
|
|
||||||
'/',
|
|
||||||
trim(
|
|
||||||
parse_url(
|
|
||||||
$this->getLink(),
|
|
||||||
5
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($splitCatArray[$indexOfArray]){
|
|
||||||
return $splitCatArray[$indexOfArray];
|
|
||||||
}else{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
trim(
|
|
||||||
parse_url(
|
|
||||||
$this->getLink(),
|
|
||||||
5
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
11
Modules/Application/Model/Vendor.php
Normal file
11
Modules/Application/Model/Vendor.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||||
|
|
||||||
|
|
||||||
|
class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor
|
||||||
|
{
|
||||||
|
use articleTreeStructure;
|
||||||
|
}
|
44
Modules/Application/Model/articleTreeStructure.php
Normal file
44
Modules/Application/Model/articleTreeStructure.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||||
|
|
||||||
|
trait articleTreeStructure
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param int $indexOfArray
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
|
||||||
|
{
|
||||||
|
if ($bShallTakeStd){
|
||||||
|
$splitCatArray =
|
||||||
|
array_values(
|
||||||
|
array_filter(
|
||||||
|
explode(
|
||||||
|
'/',
|
||||||
|
trim(
|
||||||
|
parse_url(
|
||||||
|
$this->getLink(),
|
||||||
|
5
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){
|
||||||
|
return $splitCatArray[$indexOfArray];
|
||||||
|
}else{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
trim(
|
||||||
|
parse_url(
|
||||||
|
$this->getLink(),
|
||||||
|
5
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
20
Modules/Application/Model/gtmPayment.php
Normal file
20
Modules/Application/Model/gtmPayment.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||||
|
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Model\Payment;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
|
class gtmPayment extends gtmPayment_parent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function gtmGetSelectedPaymentName() :string
|
||||||
|
{
|
||||||
|
return $this->getFieldData('oxpayments__oxdesc')?: 'No payment name available';
|
||||||
|
}
|
||||||
|
}
|
@ -12,23 +12,35 @@
|
|||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Core;
|
namespace D3\GoogleAnalytics4\Modules\Core;
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||||
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
||||||
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
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\Application\Model\User;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
|
class ViewConfig extends ViewConfig_parent
|
||||||
{
|
{
|
||||||
|
|
||||||
// Google Tag Manager Container ID
|
// Google Tag Manager Container ID
|
||||||
private $sContainerId = null;
|
private $sContainerId = null;
|
||||||
private $sCookieManagerType = null;
|
|
||||||
|
// used CMP
|
||||||
|
private $sCookieManagerType = null;#
|
||||||
|
|
||||||
|
// isModule Activated properly?
|
||||||
|
private $blGA4enabled = null;
|
||||||
|
|
||||||
public function getGtmContainerId()
|
public function getGtmContainerId()
|
||||||
{
|
{
|
||||||
if ($this->sContainerId === null)
|
if ($this->sContainerId === null)
|
||||||
{
|
{
|
||||||
$this->sContainerId = Registry::getConfig()->getConfigParam('d3_gtm_sContainerID');
|
$this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID");
|
||||||
}
|
}
|
||||||
return $this->sContainerId;
|
return $this->sContainerId;
|
||||||
}
|
}
|
||||||
@ -42,7 +54,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
{
|
{
|
||||||
/** @var ManagerHandler $oManagerHandler */
|
/** @var ManagerHandler $oManagerHandler */
|
||||||
$oManagerHandler = oxNew(ManagerHandler::class);
|
$oManagerHandler = oxNew(ManagerHandler::class);
|
||||||
$this->sCookieManagerType = $oManagerHandler->getCurrManager();
|
$this->sCookieManagerType = $oManagerHandler->getActManager();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +63,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
*/
|
*/
|
||||||
public function shallUseOwnCookieManager() :bool
|
public function shallUseOwnCookieManager() :bool
|
||||||
{
|
{
|
||||||
return (bool) Registry::getConfig()->getConfigParam('d3_gtm_settings_hasOwnCookieManager');
|
return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,17 +74,21 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
/** @var Config $oConfig */
|
/** @var Config $oConfig */
|
||||||
$oConfig = Registry::getConfig();
|
$oConfig = Registry::getConfig();
|
||||||
|
|
||||||
|
if (false === $this->isGA4enabled()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// No Cookie Manager in use
|
// No Cookie Manager in use
|
||||||
if (!$this->shallUseOwnCookieManager()) {
|
if (false === $this->shallUseOwnCookieManager()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->defineCookieManagerType();
|
$this->defineCookieManagerType();
|
||||||
|
|
||||||
$sCookieID = trim($oConfig->getConfigParam('d3_gtm_settings_controlParameter'));
|
$sCookieID = trim($this->d3GetModuleConfigParam('_sControlParameter'));
|
||||||
|
|
||||||
// Netensio Cookie Manager
|
// Netensio Cookie Manager
|
||||||
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_NET_COOKIE_MANAGER) {
|
||||||
$oSession = Registry::getSession();
|
$oSession = Registry::getSession();
|
||||||
$aCookies = $oSession->getVariable("aCookieSel");
|
$aCookies = $oSession->getVariable("aCookieSel");
|
||||||
|
|
||||||
@ -80,20 +96,18 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Aggrosoft Cookie Consent
|
// Aggrosoft Cookie Consent
|
||||||
if ($this->sCookieManagerType === ManagerTypes::AGCOOKIECOMPLIANCE) {
|
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_AGCOOKIECOMPLIANCE) {
|
||||||
if (method_exists($this, "isCookieCategoryEnabled")) {
|
if (method_exists($this, "isCookieCategoryEnabled")) {
|
||||||
return $this->isCookieCategoryEnabled($sCookieID);
|
return $this->isCookieCategoryEnabled($sCookieID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserCentrics or consentmanager
|
|
||||||
if (
|
if (
|
||||||
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
in_array
|
||||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
(
|
||||||
or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
|
$this->sCookieManagerType,
|
||||||
or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST
|
(oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray())
|
||||||
or $this->sCookieManagerType === ManagerTypes::COOKIEBOT
|
)
|
||||||
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Always needs the script-tags delivered to the DOM.
|
// Always needs the script-tags delivered to the DOM.
|
||||||
@ -111,56 +125,62 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
*/
|
*/
|
||||||
public function getGtmScriptAttributes() :string
|
public function getGtmScriptAttributes() :string
|
||||||
{
|
{
|
||||||
$sControlParameter = trim(Registry::getConfig()->getConfigParam('d3_gtm_settings_controlParameter'));
|
$sControlParameter = trim($this->d3GetModuleConfigParam('_sControlParameter'));
|
||||||
|
|
||||||
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')){
|
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
$this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
|
||||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
|
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER)
|
||||||
{
|
{
|
||||||
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
|
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEFIRST){
|
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEFIRST){
|
||||||
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
|
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
|
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEBOT){
|
||||||
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
|
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private $blGA4enabled = null;
|
/**
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
public function isGA4enabled()
|
public function isGA4enabled()
|
||||||
{
|
{
|
||||||
if ($this->blGA4enabled === null)
|
if ($this->blGA4enabled === null)
|
||||||
{
|
{
|
||||||
$this->sContainerId = Registry::getConfig()->getConfigParam('d3_gtm_blEnableGA4');
|
$this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGA4");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->blGA4enabled;
|
return $this->blGA4enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isGtmConsentModeSetActivated() :bool
|
||||||
|
{
|
||||||
|
return $this->d3GetModuleConfigParam("_blEnableConsentMode")?: false;
|
||||||
|
}
|
||||||
|
|
||||||
public function getGtmDataLayer()
|
public function getGtmDataLayer()
|
||||||
{
|
{
|
||||||
if (!$this->getGtmContainerId()) return "[]";
|
if (!$this->getGtmContainerId()) return "[]";
|
||||||
|
|
||||||
$oConfig = Registry::getConfig();
|
$oConfig = Registry::getConfig();
|
||||||
$oView = $oConfig->getTopActiveView();
|
$oView = $oConfig->getTopActiveView();
|
||||||
/** @var FrontendController $oShop */
|
/** @var User|false|null $oUser */
|
||||||
$oUser = $oConfig->getUser();
|
$oUser = $oConfig->getUser();
|
||||||
|
|
||||||
$cl = $this->getTopActiveClassName();
|
$cl = $this->getTopActiveClassName();
|
||||||
@ -183,22 +203,81 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
'title' => $oView->getTitle(),
|
'title' => $oView->getTitle(),
|
||||||
'cl' => $cl,
|
'cl' => $cl,
|
||||||
],
|
],
|
||||||
'userid' => ($oUser ? $oUser->getId() : false),
|
'userid' => $oUser instanceof User ? $oUser->getId() : false,
|
||||||
'sessionid' => session_id() ?? false,
|
'sessionid' => session_id(),
|
||||||
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$dataLayer = $this->d3AdditionalGlobalAnalyticsVariables($dataLayer);
|
||||||
|
|
||||||
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $dataLayerGlobals
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function d3AdditionalGlobalAnalyticsVariables(array $dataLayerGlobals) :array
|
||||||
|
{
|
||||||
|
/** @var User $oUser */
|
||||||
|
$oUser = Registry::getSession()->getUser();
|
||||||
|
if ($oUser and $oUser->getFieldData('OXUSERNAME')){
|
||||||
|
$sUsername = $oUser->getFieldData('OXUSERNAME') ?: "";
|
||||||
|
$iCustNr = $oUser->getFieldData('OXCUSTNR') ?: "";
|
||||||
|
$iZipCode = $oUser->getFieldData('OXZIP') ?: "";
|
||||||
|
|
||||||
|
return array_merge($dataLayerGlobals, [
|
||||||
|
'custnr' => $iCustNr,
|
||||||
|
'email' => $sUsername,
|
||||||
|
'zipcode' => $iZipCode
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return $dataLayerGlobals;
|
||||||
|
}
|
||||||
|
|
||||||
public function isDebugModeOn() :bool
|
public function isDebugModeOn() :bool
|
||||||
{
|
{
|
||||||
return Registry::getConfig()->getConfigParam('d3_gtm_blEnableDebug');
|
return $this->d3GetModuleConfigParam("_blEnableDebug")?: false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isPromotionList($listId)
|
/**
|
||||||
|
* @return string
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function getServerSidetaggingJsDomain() :string
|
||||||
{
|
{
|
||||||
$oConfig = Registry::getConfig();
|
return $this->d3GetModuleConfigParam("_sServersidetagging_js")?: "";
|
||||||
$aPromotionListIds = $oConfig->getConfigParam("") ?? ['bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross'];
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
|
public function getServerSidetaggingNoJsDomain() :string
|
||||||
|
{
|
||||||
|
return $this->d3GetModuleConfigParam('_sServersidetagging_nojs')?: "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $configParamName
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function d3GetModuleConfigParam(string $configParamName)
|
||||||
|
{
|
||||||
|
return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function d3IsUsercentricsCMPChosen() :bool
|
||||||
|
{
|
||||||
|
$sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER');
|
||||||
|
$aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList();
|
||||||
|
|
||||||
|
return (bool) ($sCMPPubName === Usercentrics::sExternalIncludationInternalName
|
||||||
|
or $sCMPPubName === Usercentrics::sModuleIncludationInternalName);
|
||||||
}
|
}
|
||||||
}
|
}
|
43
Modules/Core/WidgetControl.php
Normal file
43
Modules/Core/WidgetControl.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Core;
|
||||||
|
|
||||||
|
use OxidEsales\EshopCommunity\Core\Registry;
|
||||||
|
|
||||||
|
class WidgetControl extends WidgetControl_parent{
|
||||||
|
protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* array (
|
||||||
|
'force_sid' => '2pistlaubiq58qtg3moudei0la',
|
||||||
|
'lang' => '0',
|
||||||
|
'actcontrol' => 'details',
|
||||||
|
'anid' => '064471',
|
||||||
|
'cl' => 'oxwarticledetails',
|
||||||
|
'cnid' => '159dd0f2fb2bd6e24ace53a0f1913797',
|
||||||
|
'listtype' => 'list',
|
||||||
|
'nocookie' => '1',
|
||||||
|
'oxwparent' => 'details',
|
||||||
|
'sid' => '2pistlaubiq58qtg3moudei0la',
|
||||||
|
'stoken' => 'A22D0F9E',
|
||||||
|
'varselid' =>
|
||||||
|
array (
|
||||||
|
0 => 'b842982bf522aa839bd88221f562fce8',
|
||||||
|
),
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
$sScriptName = $_SERVER['SCRIPT_NAME'];
|
||||||
|
if($sScriptName !== '/widget.php')
|
||||||
|
{
|
||||||
|
return parent::getFrontendStartControllerKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
$aParameter = $_GET;
|
||||||
|
if(is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent']))
|
||||||
|
{
|
||||||
|
return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget';
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::getFrontendStartControllerKey();
|
||||||
|
}
|
||||||
|
}
|
44
Setup/Actions.php
Normal file
44
Setup/Actions.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Setup;
|
||||||
|
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use OxidEsales\Eshop\Core\ViewConfig;
|
||||||
|
|
||||||
|
class Actions
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string $sVarType
|
||||||
|
* @param string $sSettingName
|
||||||
|
* @param string $sSettingValue
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){
|
||||||
|
$oConfig = Registry::getConfig();
|
||||||
|
|
||||||
|
if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))){
|
||||||
|
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
|
||||||
|
}
|
||||||
|
|
||||||
|
$oConfig->saveShopConfVar(
|
||||||
|
$sVarType,
|
||||||
|
Constants::OXID_MODULE_ID.$sSettingName,
|
||||||
|
$sSettingValue,
|
||||||
|
$oConfig->getShopId(),
|
||||||
|
Constants::OXID_MODULE_ID
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $configParamName
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function d3GetModuleConfigParam(string $configParamName)
|
||||||
|
{
|
||||||
|
return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
|
||||||
|
}
|
||||||
|
}
|
37
Setup/Events.php
Normal file
37
Setup/Events.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Setup;
|
||||||
|
|
||||||
|
|
||||||
|
class Events
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function onActivate()
|
||||||
|
{
|
||||||
|
$oActions = oxNew(Actions::class);
|
||||||
|
$oActions->d3SaveDefaultSettings(
|
||||||
|
'str',
|
||||||
|
'_sServersidetagging_js',
|
||||||
|
'https://www.googletagmanager.com/gtm.js'
|
||||||
|
);
|
||||||
|
$oActions->d3SaveDefaultSettings(
|
||||||
|
'str',
|
||||||
|
'_sServersidetagging_nojs',
|
||||||
|
'https://www.googletagmanager.com/ns.html'
|
||||||
|
);
|
||||||
|
$oActions->d3SaveDefaultSettings(
|
||||||
|
'str',
|
||||||
|
'_sContainerID',
|
||||||
|
'GTM-'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public static function onDeactivate(){}
|
||||||
|
}
|
116
composer.json
116
composer.json
@ -1,56 +1,62 @@
|
|||||||
{
|
{
|
||||||
"name": "d3/google-analytics4",
|
"name": "d3/google-analytics4",
|
||||||
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
|
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
|
||||||
"type": "oxideshop-module",
|
"type": "oxideshop-module",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"oxid",
|
"oxid",
|
||||||
"modules",
|
"modules",
|
||||||
"eShop",
|
"eShop",
|
||||||
"d3",
|
"d3",
|
||||||
"google",
|
"google",
|
||||||
"ga4",
|
"ga4",
|
||||||
"googleanalytics",
|
"googleanalytics",
|
||||||
"gtm",
|
"gtm",
|
||||||
"configuration"
|
"configuration"
|
||||||
],
|
],
|
||||||
"homepage": "https://www.d3data.de",
|
"homepage": "https://www.d3data.de",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-3.0"
|
"GPL-3.0"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Marat Bedoev",
|
"name": "Marat Bedoev",
|
||||||
"email": "hello@mb-dev.pro"
|
"email": "hello@mb-dev.pro"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
||||||
"email": "info@shopmodule.com",
|
"email": "info@shopmodule.com",
|
||||||
"homepage": "https://www.d3data.de"
|
"homepage": "https://www.d3data.de"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"email": "support@shopmodule.com"
|
"email": "support@shopmodule.com"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"oxideshop": {
|
"oxideshop": {
|
||||||
"blacklist-filter": [
|
"blacklist-filter": [
|
||||||
"*.md",
|
"*.md",
|
||||||
"composer.json",
|
"composer.json",
|
||||||
".php-cs-fixer.php",
|
".php-cs-fixer.php",
|
||||||
"*.xml",
|
"*.neon"
|
||||||
"*.neon"
|
],
|
||||||
],
|
"target-directory": "d3/googleanalytics4"
|
||||||
"target-directory": "d3/googleanalytics4"
|
}
|
||||||
}
|
},
|
||||||
},
|
"require": {
|
||||||
"require": {
|
"php": "7.1 - 8.2",
|
||||||
"php": ">=7.1",
|
"oxid-esales/oxideshop-ce": "^6.5.3",
|
||||||
"oxid-esales/oxideshop-ce": "v6.0 - 6.3",
|
"google/apiclient":" ^2.0"
|
||||||
"google/apiclient":" ^2.0"
|
},
|
||||||
},
|
"require-dev": {
|
||||||
"autoload": {
|
"phpstan/phpstan": "^1.10"
|
||||||
"psr-4": {
|
},
|
||||||
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
"autoload": {
|
||||||
}
|
"psr-4": {
|
||||||
}
|
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/googleanalytics4/.php-cs-fixer.php",
|
||||||
|
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/googleanalytics4/.php-cs-fixer.php"
|
||||||
|
}
|
||||||
}
|
}
|
8
menu.xml
Normal file
8
menu.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="ISO-8859-15"?>
|
||||||
|
<OX>
|
||||||
|
<OXMENU id="d3mxd3modules">
|
||||||
|
<MAINMENU id="d3mxgoogleanalytics4">
|
||||||
|
<SUBMENU id="d3mxgoogleanalytics4set" cl="d3googleanalytics4_main"/>
|
||||||
|
</MAINMENU>
|
||||||
|
</OXMENU>
|
||||||
|
</OX>
|
240
metadata.php
240
metadata.php
@ -1,22 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Controller\Admin\GA4AdminUserInterface_main as GA4AdminUserInterfaceMainController;
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\Constants as Constants;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Component\d3GtmBasketComponentExtension;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Component\Widget\d3GtmWidgetArticleDetails as d3GtmWidgetArticleDetails;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleDetailsController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleListController_AddToCartHelpMethods;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController;
|
use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountNoticeListController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountRecommlistController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountWishlistController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmManufacturerListController as d3GtmManufacturerListController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmSearchController;
|
||||||
|
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
|
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
|
||||||
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\gtmPayment as gtmPayment;
|
||||||
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\Component\BasketComponent as OEBasketComponent;
|
||||||
|
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails as OEArticleDetails;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\AccountNoticeListController as OEAccountNoticeListController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\AccountRecommlistController as OEAccountRecommlistController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\AccountWishlistController as OEAccountWishlistController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\ArticleDetailsController as OEArticleDetailsController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\ArticleListController as OEArticleListController;
|
||||||
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
|
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\ManufacturerListController as OEManufacturerListController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\SearchController as OESearchController;
|
||||||
|
use OxidEsales\Eshop\Application\Controller\StartController as OEStartController;
|
||||||
use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouController;
|
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;
|
||||||
|
use OxidEsales\Eshop\Application\Model\Payment as OEPayment;
|
||||||
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
||||||
|
|
||||||
$sMetadataVersion = '2.1';
|
$sMetadataVersion = '2.1';
|
||||||
$aModule = [
|
$aModule = [
|
||||||
'id' => 'd3googleanalytics4',
|
'id' => Constants::OXID_MODULE_ID,
|
||||||
'title' => 'Google Analytics 4',
|
'title' => 'Google Analytics 4',
|
||||||
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property'
|
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property'
|
||||||
Google Analytics 4 (GA4) von Google zu integrieren.<br>
|
Google Analytics 4 (GA4) von Google zu integrieren.<br>
|
||||||
HierfĂĽr stehen Ihnen verschiedene 'templates' zur verfĂĽgung,
|
HierfĂĽr stehen Ihnen verschiedene 'templates' zur verfĂĽgung,
|
||||||
@ -27,124 +51,156 @@ $aModule = [
|
|||||||
<hr>
|
<hr>
|
||||||
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' => '1.13.0',
|
'version' => '2.23.0.2',
|
||||||
'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/',
|
||||||
'extend' => [
|
'controllers' => [
|
||||||
OEViewConfig::class => ViewConfig::class,
|
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class
|
||||||
|
],
|
||||||
|
'extend' => [
|
||||||
|
// Core
|
||||||
|
OEViewConfig::class => ViewConfig::class,
|
||||||
|
\OxidEsales\Eshop\Core\WidgetControl::class => \D3\GoogleAnalytics4\Modules\Core\WidgetControl::class,
|
||||||
|
|
||||||
|
// Model
|
||||||
OECategory::class => Category::class,
|
OECategory::class => Category::class,
|
||||||
OEBasket::class => Basket::class,
|
OEBasket::class => Basket::class,
|
||||||
OEBasketController::class => BasketController::class,
|
|
||||||
OEManufacturer::class => Manufacturer::class,
|
OEManufacturer::class => Manufacturer::class,
|
||||||
OEThankYouController::class => ThankYouController::class
|
OEPayment::class => gtmPayment::class,
|
||||||
|
|
||||||
|
// Controller
|
||||||
|
OEBasketController::class => BasketController::class,
|
||||||
|
OEThankYouController::class => ThankYouController::class,
|
||||||
|
OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class,
|
||||||
|
OEArticleDetailsController::class => ArticleDetailsController::class,
|
||||||
|
OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class,
|
||||||
|
OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class,
|
||||||
|
OEAccountWishlistController::class => d3GtmAccountWishlistController::class,
|
||||||
|
OEStartController::class => d3GtmStartController::class,
|
||||||
|
OESearchController::class => d3GtmSearchController::class,
|
||||||
|
OEManufacturerListController::class => d3GtmManufacturerListController::class,
|
||||||
|
|
||||||
|
// Component
|
||||||
|
OEArticleDetails::class => d3GtmWidgetArticleDetails::class,
|
||||||
|
OEBasketComponent::class => d3GtmBasketComponentExtension::class,
|
||||||
],
|
],
|
||||||
'templates' => [],
|
'templates' => [
|
||||||
'blocks' => [
|
// Event files that store the GA4 Event-Information
|
||||||
|
'event/add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/event/add_to_cart.tpl',
|
||||||
|
'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
|
||||||
|
'event/view_cart.tpl' => 'd3/googleanalytics4/Application/views/event/view_cart.tpl',
|
||||||
|
'event/begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/event/begin_checkout.tpl',
|
||||||
|
'event/add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/event/add_payment_info.tpl',
|
||||||
|
'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl',
|
||||||
|
'event/view_item_list.tpl' => 'd3/googleanalytics4/Application/views/event/view_item_list.tpl',
|
||||||
|
'event/view_search_result.tpl' => 'd3/googleanalytics4/Application/views/event/view_search_result.tpl',
|
||||||
|
'event/remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/event/remove_from_cart.tpl',
|
||||||
|
|
||||||
|
// complete overwritten file of OXID-Originals
|
||||||
|
// the path of the template-name is the original path to the file in OXID-context from tpl/->
|
||||||
|
'page/account/d3gtmnoticelist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmnoticelist.tpl',
|
||||||
|
'page/account/d3gtmrecommendationlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl',
|
||||||
|
'page/account/d3gtmwishlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmwishlist.tpl',
|
||||||
|
|
||||||
|
// Admin Templates
|
||||||
|
'ga4/admin/d3ga4uimain.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_main.tpl',
|
||||||
|
'ga4/admin/d3ga4uiheaditem.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_headitem.tpl',
|
||||||
|
],
|
||||||
|
'blocks' => [
|
||||||
// tag manager js
|
// tag manager js
|
||||||
[
|
[
|
||||||
'template' => 'layout/base.tpl',
|
'template' => 'layout/base.tpl',
|
||||||
'block' => 'head_meta_robots',
|
'block' => 'head_meta_robots',
|
||||||
'file' => '/Application/views/blocks/_gtm_js.tpl',
|
'file' => '/Application/views/blocks/_gtm_js.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
// tag manager nojs
|
// tag manager nojs
|
||||||
[
|
[
|
||||||
'template' => 'layout/base.tpl',
|
'template' => 'layout/base.tpl',
|
||||||
'block' => 'theme_svg_icons',
|
'block' => 'theme_svg_icons',
|
||||||
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
||||||
],
|
],
|
||||||
// details
|
// details
|
||||||
[
|
[
|
||||||
'template' => 'page/details/inc/productmain.tpl',
|
'template' => 'page/details/inc/productmain.tpl',
|
||||||
'block' => 'details_productmain_title',
|
'block' => 'details_productmain_title',
|
||||||
'file' => '/Application/views/blocks/view_item.tpl',
|
'file' => '/Application/views/blocks/view_item.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
// checkout
|
// View Cart
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/basket.tpl',
|
'template' => 'page/checkout/basket.tpl',
|
||||||
'block' => 'checkout_basket_main',
|
'block' => 'checkout_basket_main',
|
||||||
'file' => '/Application/views/blocks/view_cart.tpl'
|
'file' => '/Application/views/blocks/view_cart.tpl'
|
||||||
],
|
|
||||||
[
|
|
||||||
'template' => 'page/checkout/thankyou.tpl',
|
|
||||||
'block' => 'checkout_thankyou_main',
|
|
||||||
'file' => '/Application/views/blocks/purchase.tpl'
|
|
||||||
],
|
|
||||||
// Lists
|
|
||||||
// view_item_list
|
|
||||||
[
|
|
||||||
'template' => 'page/list/list.tpl',
|
|
||||||
'block' => 'page_list_productlist',
|
|
||||||
'file' => '/Application/views/ga4/view_item_list.tpl',
|
|
||||||
'position' => 150
|
|
||||||
],
|
|
||||||
// view_search_result
|
|
||||||
[
|
|
||||||
'template' => 'page/search/search.tpl',
|
|
||||||
'block' => 'search_results',
|
|
||||||
'file' => '/Application/views/ga4/view_search_result.tpl',
|
|
||||||
'position' => 150
|
|
||||||
],
|
],
|
||||||
// add_to_cart
|
// add_to_cart
|
||||||
[
|
[
|
||||||
'template' => 'page/details/inc/productmain.tpl',
|
'template' => 'page/details/inc/productmain.tpl',
|
||||||
'block' => 'details_productmain_tobasket',
|
'block' => 'details_productmain_tobasket',
|
||||||
'file' => '/Application/views/ga4/add_to_cart.tpl',
|
'file' => '/Application/views/blocks/details_productmain_tobasket.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
// remove_from_cart
|
// remove_from_cart
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/basket.tpl',
|
'template' => 'page/checkout/basket.tpl',
|
||||||
'block' => 'checkout_basket_main',
|
'block' => 'checkout_basket_main',
|
||||||
'file' => '/Application/views/ga4/remove_from_cart.tpl',
|
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
]
|
],
|
||||||
|
[
|
||||||
|
'template' => 'page/checkout/thankyou.tpl',
|
||||||
|
'block' => 'checkout_thankyou_main',
|
||||||
|
'file' => '/Application/views/blocks/purchase.tpl'
|
||||||
|
],
|
||||||
|
// Lists
|
||||||
|
// view_item_list
|
||||||
|
[
|
||||||
|
'template' => 'page/list/list.tpl',
|
||||||
|
'block' => 'page_list_productlist',
|
||||||
|
'file' => '/Application/views/blocks/view_item_list.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
// view_search_result
|
||||||
|
[
|
||||||
|
'template' => 'page/search/search.tpl',
|
||||||
|
'block' => 'search_results',
|
||||||
|
'file' => '/Application/views/blocks/view_search_result.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'template' => 'page/list/list.tpl',
|
||||||
|
'block' => 'page_list_listbody',
|
||||||
|
'file' => '/Application/views/blocks/page_list_listbody.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'template' => 'page/shop/start.tpl',
|
||||||
|
'block' => 'start_welcome_text',
|
||||||
|
'file' => '/Application/views/blocks/start_welcome_text.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
// Checkout process
|
||||||
|
// Begin CHeckout
|
||||||
|
[
|
||||||
|
'template' => 'page/checkout/user.tpl',
|
||||||
|
'block' => 'checkout_user_main',
|
||||||
|
'file' => '/Application/views/blocks/begin_checkout.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
// Add payment info
|
||||||
|
// We add it into checkout_order_main ( checkout/order.tpl ) to make sure a payment is actually added;
|
||||||
|
// we'll also do it like that in the future for add_shipping_info ( not planed yet )
|
||||||
|
[
|
||||||
|
'template' => 'page/checkout/order.tpl',
|
||||||
|
'block' => 'checkout_order_main',
|
||||||
|
'file' => '/Application/views/blocks/add_payment_info.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'events' => [
|
||||||
|
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
|
||||||
|
'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate',
|
||||||
],
|
],
|
||||||
'settings' => [
|
|
||||||
[
|
|
||||||
'group' => 'd3_gtm_settings',
|
|
||||||
'name' => 'd3_gtm_sContainerID',
|
|
||||||
'type' => 'str',
|
|
||||||
'value' => 'GTM-',
|
|
||||||
'position' => 0
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'group' => 'd3_gtm_settings',
|
|
||||||
'name' => 'd3_gtm_blGA4enab',
|
|
||||||
'type' => 'bool',
|
|
||||||
'value' => true,
|
|
||||||
'position' => 1
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'group' => 'd3_gtm_settings',
|
|
||||||
'name' => 'd3_gtm_blEnableDebug',
|
|
||||||
'type' => 'bool',
|
|
||||||
'value' => false,
|
|
||||||
'position' => 999
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'group' => 'd3_gtm_settings_cookiemanager',
|
|
||||||
'name' => 'd3_gtm_settings_hasOwnCookieManager',
|
|
||||||
'type' => 'bool',
|
|
||||||
'value' => false,
|
|
||||||
'position' => 999
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'group' => 'd3_gtm_settings_cookiemanager',
|
|
||||||
'name' => 'd3_gtm_settings_controlParameter',
|
|
||||||
'type' => 'str',
|
|
||||||
'value' => '',
|
|
||||||
'position' => 999
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'group' => 'd3_gtm_settings_cookiemanager',
|
|
||||||
'name' => 'd3_gtm_settings_HAS_STD_MANAGER',
|
|
||||||
'type' => 'select',
|
|
||||||
'value' => 'none',
|
|
||||||
'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS|COOKIEFIRST|COOKIEBOT',
|
|
||||||
],
|
|
||||||
]
|
|
||||||
];
|
];
|
13
phpstan.neon
13
phpstan.neon
@ -1,10 +1,15 @@
|
|||||||
parameters:
|
parameters:
|
||||||
scanFiles:
|
scanFiles:
|
||||||
- IntelliSenseHelper.php
|
- IntelliSenseHelper.php
|
||||||
|
- ../../oxid-esales/oxideshop-ce/source/bootstrap.php
|
||||||
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
|
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
|
||||||
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
||||||
level: 9
|
scanDirectories:
|
||||||
phpVersion: 70100
|
- ../../oxid-esales
|
||||||
checkMissingIterableValueType: false
|
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
- '#Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
|
- '#.*is not subtype of Throwable.*#'
|
||||||
|
paths:
|
||||||
|
- ./
|
||||||
|
level: 5
|
||||||
|
phpVersion: 80100
|
||||||
|
checkMissingIterableValueType: false
|
||||||
|
Reference in New Issue
Block a user