Compare commits
91 Commits
Author | SHA1 | Date | |
---|---|---|---|
106fea9c91 | |||
13132e6da0 | |||
5c478124bc | |||
12613357b3 | |||
95e0cab68c | |||
1d194d445a | |||
bf3fee5ce5 | |||
3c280a3adb | |||
6217524828 | |||
5ef600ff2a | |||
a40d922f42 | |||
dae5f66f81 | |||
347e551194 | |||
000c49c56b | |||
002cc69d2a | |||
af78809ae5 | |||
d531ba648b | |||
a0c650fca3 | |||
af341a984b | |||
122dd4cf53 | |||
27798703b0 | |||
8eb734be8a | |||
6d155d310b | |||
6e62f39b71 | |||
616f31ecba | |||
527eec1355 | |||
1966d3008e | |||
bd51b37159 | |||
718b60e12c | |||
d4df87bfff | |||
4222c947a9 | |||
d8fa06233b | |||
4e0988307a | |||
0e55c3e38f | |||
13df965a03 | |||
1ff6f0159f | |||
63007e9b02 | |||
5fe656988c | |||
9cb3a54824 | |||
2f6fd8a31c | |||
707e389f54 | |||
98533cf7f7 | |||
8f9ed021d6 | |||
0ef3d3373a | |||
fd2b4a5bbe | |||
1c0d55bdc3 | |||
7c1f99e678 | |||
126e746651 | |||
1c45a16356 | |||
1589f202a9 | |||
25234abfd8 | |||
667b48ac4b | |||
5e358fc684 | |||
55bd7b7fb4 | |||
3c1e6a11ff | |||
9ac78a0d43 | |||
e2bcb34051 | |||
4ea0c19d7b | |||
3ff03ee0df | |||
09c1e31efe | |||
6d057971a7 | |||
0b134321ef | |||
b5d056fd83 | |||
410be2fb40 | |||
bd17c3370d | |||
56740f1f10 | |||
daed30a585 | |||
48d411ac3f | |||
b530366cb8 | |||
975d07056a | |||
d028f418ad | |||
24bf113d30 | |||
ca6a810fa3 | |||
62b382eadf | |||
cecbc0dec8 | |||
6a0fb759e1 | |||
120c765d0c | |||
4f73f18080 | |||
45d8e45137 | |||
70f2308575 | |||
00f76d9908 | |||
306af0f7bd | |||
6eb15ec080 | |||
d722c46a74 | |||
d847a34e99 | |||
7b55d1d57c | |||
a25be1069c | |||
5200232a32 | |||
bcd785774b | |||
5ba613df30 | |||
a1dc0a6a58 |
53
Application/Model/ManagerHandler.php
Normal file
53
Application/Model/ManagerHandler.php
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Model;
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
use OxidEsales\Eshop\Core\ViewConfig;
|
||||||
|
|
||||||
|
class ManagerHandler
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getCurrManager() :string
|
||||||
|
{
|
||||||
|
/** @var ManagerTypes $oManagerTypes */
|
||||||
|
$oManagerTypes = oxNew(ManagerTypes::class);
|
||||||
|
|
||||||
|
/** @var ViewConfig $oViewConfig */
|
||||||
|
$oViewConfig = oxNew(ViewConfig::class);
|
||||||
|
|
||||||
|
$aManagerList = $oManagerTypes->getManagerList();
|
||||||
|
|
||||||
|
foreach ($aManagerList as $managerName){
|
||||||
|
if ($oViewConfig->isModuleActive($managerName)){
|
||||||
|
return $managerName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getExplicitManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getModuleSettingExplicitManagerSelectValue() :string
|
||||||
|
{
|
||||||
|
return Registry::getConfig()->getConfigParam('d3_gtm_settings_HAS_STD_MANAGER');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getExplicitManager() :string
|
||||||
|
{
|
||||||
|
$sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue();
|
||||||
|
|
||||||
|
/** @var ManagerTypes $oManagerTypes */
|
||||||
|
$oManagerTypes = oxNew(ManagerTypes::class);
|
||||||
|
return $oManagerTypes->isManagerInList($sPotentialManagerName)
|
||||||
|
? $sPotentialManagerName
|
||||||
|
: "NONE";
|
||||||
|
}
|
||||||
|
}
|
60
Application/Model/ManagerTypes.php
Normal file
60
Application/Model/ManagerTypes.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Application\Model;
|
||||||
|
|
||||||
|
class ManagerTypes
|
||||||
|
{
|
||||||
|
#ToDo: make own classes for each of the manager
|
||||||
|
|
||||||
|
|
||||||
|
const EXTERNAL_SERVICE = "externalService";
|
||||||
|
const NET_COOKIE_MANAGER = "net_cookie_manager";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Further information's:
|
||||||
|
* https://github.com/aggrosoft/oxid-cookie-compliance
|
||||||
|
*/
|
||||||
|
const AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used the OXID Module.
|
||||||
|
*
|
||||||
|
* Further information's:
|
||||||
|
* https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html
|
||||||
|
*
|
||||||
|
* Usercentrics homepage:
|
||||||
|
* https://usercentrics.com
|
||||||
|
*/
|
||||||
|
const USERCENTRICS_MODULE = "oxps_usercentrics";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* manually included usercentrics script
|
||||||
|
*/
|
||||||
|
const USERCENTRICS_MANUALLY = "USERCENTRICS";
|
||||||
|
|
||||||
|
const CONSENTMANAGER = "CONSENTMANAGER";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getManagerList(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"externalService" => self::EXTERNAL_SERVICE,
|
||||||
|
"agcookiecompliance" => self::AGCOOKIECOMPLIANCE,
|
||||||
|
"net_cookie_manager" => self::NET_COOKIE_MANAGER,
|
||||||
|
"oxps_usercentrics" => self::USERCENTRICS_MODULE,
|
||||||
|
"usercentrics" => self::USERCENTRICS_MANUALLY,
|
||||||
|
"consentmanager" => self::CONSENTMANAGER
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sManager
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isManagerInList(string $sManager) :bool
|
||||||
|
{
|
||||||
|
return in_array($sManager, $this->getManagerList(), true);
|
||||||
|
}
|
||||||
|
}
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* [bla] tag-manager
|
|
||||||
* Copyright (C) 2018 bestlife AG
|
|
||||||
* info: oxid@bestlife.ag
|
|
||||||
*
|
|
||||||
* This program is free software;
|
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
**/
|
|
||||||
|
|
||||||
$aLang = [
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
|
|
||||||
// das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch
|
|
||||||
// leserliche Namen fĂĽr product list performance (GA)
|
|
||||||
'VT_GTM_EE_productList' => 'Kategorie',
|
|
||||||
'VT_GTM_EE_categoryList' => 'Kategorie',
|
|
||||||
'VT_GTM_EE_searchList' => 'Suchergebnisse',
|
|
||||||
'VT_GTM_EE_cross' => 'Crossselling',
|
|
||||||
'VT_GTM_EE_accessories' => 'Zubehör',
|
|
||||||
'VT_GTM_EE_alsoBought' => 'Kunden kaufen auch',
|
|
||||||
'VT_GTM_EE_last' => 'Zuletzt angesehen',
|
|
||||||
'VT_GTM_EE_bargainItems' => 'Angebot der Woche',
|
|
||||||
'VT_GTM_EE_newItems' => 'Frisch eingetroffen',
|
|
||||||
'VT_GTM_EE_topBox' => 'Topseller',
|
|
||||||
// ab hier wird wieder benötigt
|
|
||||||
|
|
||||||
// Dimensionen im checkout
|
|
||||||
'VT_GTM_EE_LOGINOPTION' => 'Bestandskunde',
|
|
||||||
'VT_GTM_EE_LOGINOPTION1' => 'Gastbestellung',
|
|
||||||
'VT_GTM_EE_LOGINOPTION2' => 'Bestandskunde',
|
|
||||||
'VT_GTM_EE_LOGINOPTION3' => 'Neukunde'
|
|
||||||
|
|
||||||
];
|
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* [bla] tag-manager
|
|
||||||
* Copyright (C) 2018 bestlife AG
|
|
||||||
* info: oxid@bestlife.ag
|
|
||||||
*
|
|
||||||
* This program is free software;
|
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
**/
|
|
||||||
|
|
||||||
$aLang = [
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
|
|
||||||
|
|
||||||
// das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch
|
|
||||||
// leserliche Namen fĂĽr product list performance (GA)
|
|
||||||
'VT_GTM_EE_productList' => 'Category',
|
|
||||||
'VT_GTM_EE_searchList' => 'Search',
|
|
||||||
'VT_GTM_EE_cross' => 'Crossselling',
|
|
||||||
'VT_GTM_EE_accessories' => 'Accessories',
|
|
||||||
'VT_GTM_EE_last' => 'Last Seen',
|
|
||||||
'VT_GTM_EE_bargainItems' => 'Offer of the Week',
|
|
||||||
'VT_GTM_EE_newItems' => 'Just Arrived',
|
|
||||||
'VT_GTM_EE_topBox' => 'Topseller',
|
|
||||||
// ab hier wird wieder benötigt
|
|
||||||
|
|
||||||
// Dimensionen im checkout
|
|
||||||
'VT_GTM_EE_LOGINOPTION' => 'Existing Customer',
|
|
||||||
'VT_GTM_EE_LOGINOPTION1' => 'Guest',
|
|
||||||
'VT_GTM_EE_LOGINOPTION2' => 'Existing Customer',
|
|
||||||
'VT_GTM_EE_LOGINOPTION3' => 'New Customer'
|
|
||||||
];
|
|
@ -1,16 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
/*
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* vanilla-thunder/oxid-module-gtm
|
* file that was distributed with this source code.
|
||||||
* Google Tag Manager Integration for OXID eShop v6.2+
|
|
||||||
*
|
*
|
||||||
* This program is free software;
|
* https://www.d3data.de
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
* @link https://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$style = '<style type="text/css">
|
$style = '<style type="text/css">
|
||||||
@ -25,22 +22,19 @@ input.confinput:hover {outline:3px solid #ff3600;}
|
|||||||
</style>';
|
</style>';
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
'SHOP_MODULE_vt_gtm_sContainerID' => 'Container ID',
|
'SHOP_MODULE_d3_gtm_sContainerID' => 'Container ID',
|
||||||
'SHOP_MODULE_GROUP_vt_gtm_settings' => 'Einstellungen',
|
'SHOP_MODULE_GROUP_d3_gtm_settings' => 'Einstellungen',
|
||||||
'SHOP_MODULE_vt_gtm_blGA4enab' => 'GA4 Aktivieren',
|
'SHOP_MODULE_d3_gtm_blGA4enab' => 'GA4 Aktivieren',
|
||||||
'SHOP_MODULE_vt_gtm_blUAenabled' => 'UA Aktivieren',
|
'SHOP_MODULE_d3_gtm_blUAenabled' => 'UA Aktivieren',
|
||||||
'SHOP_MODULE_vt_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
|
'SHOP_MODULE_d3_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
|
||||||
|
|
||||||
// for cookie manager settings
|
// for cookie manager settings
|
||||||
'SHOP_MODULE_GROUP_vt_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
||||||
'SHOP_MODULE_vt_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen?
|
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Cookie Manager nutzen?',
|
||||||
<strong style="color: red">Hinweis (Fragezeichen) lesen!</strong>',
|
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?<br>
|
||||||
'HELP_SHOP_MODULE_vt_gtm_settings_hasOwnCookieManager' => 'Stellen Sie sicher, dass Sie ein Modul installiert haben,
|
Dann wählen Sie bitte die zutreffende aus.',
|
||||||
dass die Methode "blAcceptedCookie" implementiert.<br> Sollten Sie sich nicht sicher sein kontaktieren Sie Ihren
|
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_NONE' => '---',
|
||||||
technischen Ansprechpartner.<br><br>
|
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
|
||||||
|
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
|
||||||
<strong>Wichtig!</strong> Das Aktivieren dieser Checkbox kann <u>ohne dem nötigen technischen Wissen</u> den Shop-Ablauf im Frontend stören!<hr>
|
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'CookieID',
|
||||||
Die Checkbox muss nicht aktiviert werden, sofern die Cookies beispielsweise direkt via Google Cookie-Banner integriert werden.
|
|
||||||
Bei Fragen <u>kontaktieren Sie bitte</u> auch hier einen entsprechenden technischen Ansprechpartner.',
|
|
||||||
'SHOP_MODULE_vt_gtm_settings_cookieName' => 'Cookie-Name',
|
|
||||||
];
|
];
|
||||||
|
@ -1,41 +1,12 @@
|
|||||||
[{assign var="d3VtConfigObject" value=$oViewConf->getConfig()}]
|
[{* Always prepare the data layer to avoid errors *}]
|
||||||
[{if $d3VtConfigObject->getConfigParam('vt_gtm_settings_hasOwnCookieManager')}]
|
<script>
|
||||||
[{if $oViewConf->blAcceptedCookie($d3VtConfigObject->getConfigParam('vt_gtm_settings_cookieName'))}]
|
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||||
|
</script>
|
||||||
|
|
||||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
[{if $oViewConf->D3blShowGtmScript()}]
|
||||||
<!-- Google Tag Manager -->
|
|
||||||
<script>
|
|
||||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
|
||||||
(function (w, d, s, l, i) {
|
|
||||||
w[l] = w[l] || [];
|
|
||||||
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 : '';
|
|
||||||
j.async = true;
|
|
||||||
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
|
||||||
f.parentNode.insertBefore(j, f);
|
|
||||||
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
|
||||||
</script>
|
|
||||||
<!-- End Google Tag Manager -->
|
|
||||||
[{$oViewConf->triggerGA4events()}]
|
|
||||||
[{if $oViewConf->getTopActionClassName() === "alist" }]
|
|
||||||
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
|
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "details" }]
|
|
||||||
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
|
||||||
|
|
||||||
[{/if}]
|
|
||||||
[{/strip}][{/if}]
|
|
||||||
[{else}]
|
|
||||||
<script>
|
|
||||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
|
||||||
</script>
|
|
||||||
[{/if}]
|
|
||||||
[{else}]
|
|
||||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||||
<!-- Google Tag Manager -->
|
<!-- Google Tag Manager -->
|
||||||
<script>
|
<script [{$oViewConf->getGtmScriptAttributes()}]>
|
||||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
|
||||||
(function (w, d, s, l, i) {
|
(function (w, d, s, l, i) {
|
||||||
w[l] = w[l] || [];
|
w[l] = w[l] || [];
|
||||||
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
||||||
@ -46,16 +17,15 @@
|
|||||||
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
||||||
</script>
|
</script>
|
||||||
<!-- End Google Tag Manager -->
|
<!-- End Google Tag Manager -->
|
||||||
[{$oViewConf->triggerGA4events()}]
|
|
||||||
[{if $oViewConf->getTopActionClassName() === "alist" }]
|
[{if $oViewConf->getTopActionClassName() === "alist" }]
|
||||||
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
|
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "details" }]
|
[{elseif $oViewConf->getTopActionClassName() === "details" }]
|
||||||
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
||||||
|
|
||||||
[{/if}]
|
[{/if}]
|
||||||
[{/strip}][{/if}]
|
[{/strip}][{/if}]
|
||||||
[{/if}]
|
[{/if}]
|
||||||
|
|
||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
@ -1,8 +1,12 @@
|
|||||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
[{if $oViewConf->D3blShowGtmScript()}]
|
||||||
|
[{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="https://www.googletagmanager.com/ns.html?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) -->[{/strip}][{/if}]
|
<!-- End Google Tag Manager (noscript) -->
|
||||||
|
[{/strip}][{/if}]
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
@ -1,66 +0,0 @@
|
|||||||
[{$smarty.block.parent}]
|
|
||||||
[{*
|
|
||||||
[{strip}]
|
|
||||||
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
|
|
||||||
[{if !$head }]
|
|
||||||
[{assign var=$head value=$oView->getViewParameter('head')}]
|
|
||||||
[{/if}]
|
|
||||||
<script>
|
|
||||||
var gtmItem = {
|
|
||||||
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
|
||||||
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
|
||||||
|
|
||||||
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
|
||||||
'item_name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
|
||||||
|
|
||||||
'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
|
|
||||||
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
|
|
||||||
|
|
||||||
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
|
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value}],
|
|
||||||
|
|
||||||
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]',
|
|
||||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]',
|
|
||||||
|
|
||||||
[{if $listId == 'productList' || $listId == 'categoryList'}]
|
|
||||||
/* category list */
|
|
||||||
'list': '[{$listId}]',
|
|
||||||
'item_list_id': '[{$listId}]',
|
|
||||||
'item_list_name': '[{$head}]',
|
|
||||||
[{elseif $listId}]
|
|
||||||
/* category list */
|
|
||||||
'list': '[{$listId}]',
|
|
||||||
'promotion_id': '[{$listId}]',
|
|
||||||
'promotion_name': '[{$head}]',
|
|
||||||
[{/if}]
|
|
||||||
'position': [{$iIndex}],
|
|
||||||
'index': [{$iIndex}],
|
|
||||||
'quantity': '1'
|
|
||||||
};
|
|
||||||
/* UA */
|
|
||||||
dataLayer.push({ ecommerce: null });
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'UA_event',
|
|
||||||
'event_name': 'Impression',
|
|
||||||
'ecommerce': {
|
|
||||||
'currencyCode': '[{$currency->name}]',
|
|
||||||
'impressions': [gtmItem]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/* GA4 */
|
|
||||||
dataLayer.push({ ecommerce: null });
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'GA4_event',
|
|
||||||
'event_name': 'view_item_list',
|
|
||||||
'ecommerce': {
|
|
||||||
'items': [gtmItem]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{/strip}]
|
|
||||||
*}]
|
|
@ -1,5 +0,0 @@
|
|||||||
[{if $oxcmp_basket->isNewItemAdded() && $smarty.session._newitem}]
|
|
||||||
<!-- [{$smarty.session._newitem|@var_dump}] -->
|
|
||||||
[{* include file="ga4_add_to_cart.tpl" gtmProduct=$smarty.session._newitem *}]
|
|
||||||
[{/if}]
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||||
|
|
||||||
|
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||||
|
|
||||||
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
||||||
[{strip}][{capture assign=d3_ga4_view_cart}]
|
[{strip}][{capture assign=d3_ga4_view_cart}]
|
||||||
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. */
|
||||||
@ -11,15 +13,15 @@
|
|||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'actionField': "step: 1",
|
'actionField': "step: 1",
|
||||||
'currency': "[{$currency->name}]",
|
'currency': "[{$currency->name}]",
|
||||||
'value': [{$oxcmp_basket->getBruttoSum()}],
|
'value': [{$d3BasketPrice->getPrice()}],
|
||||||
'items': [
|
'items': [
|
||||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||||
[{assign var='_price' value=$basketitem->getUnitPrice()}]
|
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
||||||
{
|
{
|
||||||
'item_id': '[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]',
|
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||||
'item_name': '[{$gtmCartArticles[$basketindex]->oxarticles__oxtitle->value}]',
|
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||||
'item_variant': '[{$gtmCartArticles[$basketindex]->oxarticles__oxvarselect->value}]',
|
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||||
'price': [{$_price->getPrice()}],
|
'price': [{$d3oItemPrice->getPrice()}],
|
||||||
'quantity':[{$basketitem->getAmount()}],
|
'quantity':[{$basketitem->getAmount()}],
|
||||||
'position':[{$smarty.foreach.gtmCartContents.index}]
|
'position':[{$smarty.foreach.gtmCartContents.index}]
|
||||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
[{strip}]
|
|
||||||
<script>
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event':'ee.checkout',
|
|
||||||
'eventLabel':'Checkout Step 2',
|
|
||||||
'ecommerce': {
|
|
||||||
'checkout': {
|
|
||||||
'actionField': {
|
|
||||||
'step': 2,
|
|
||||||
'option':'[{oxmultilang ident="VT_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{/strip}]
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -1,9 +0,0 @@
|
|||||||
<script>
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'ee.checkout',
|
|
||||||
'eventLabel': 'Checkout Step 3',
|
|
||||||
'ecommerce': {'checkout': {'actionField': {'step': 3}}}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -1,9 +0,0 @@
|
|||||||
<script>
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
"event": "ee.checkout",
|
|
||||||
'eventLabel': 'Checkou Step 4',
|
|
||||||
"ecommerce": {"checkout": {"actionField": {"step": 4}}}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -10,21 +10,22 @@
|
|||||||
'event': 'purchase',
|
'event': 'purchase',
|
||||||
'eventLabel':'Checkout Step 5',
|
'eventLabel':'Checkout Step 5',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'transaction_id': '[{$_gtmOrder->oxorder__oxordernr->value}]',
|
'transaction_id': '[{$_gtmOrder->getFieldData("oxordernr")}]',
|
||||||
'affiliation': '[{$oxcmp_shop->oxshops__oxname->value}]',
|
'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]',
|
||||||
'value': '[{$_gtmOrder->oxorder__oxtotalordersum->value}]',
|
'value': [{$_gtmOrder->getTotalOrderSum()}],
|
||||||
'tax': '[{math equation="x+y" x=$_gtmOrder->oxorder__oxartvatprice1->value y=$_gtmOrder->oxorder__oxartvatprice2->value }]',
|
'tax': [{math equation="x+y" x=$_gtmOrder->getFieldData("oxartvatprice1") y=$_gtmOrder->getFieldData("oxartvatprice2") }],
|
||||||
'shipping': '[{$_gtmOrder->oxorder__oxdelcost->value}]',
|
'shipping': [{$_gtmOrder->getFieldData("oxdelcost")}],
|
||||||
'currency': '[{$_gtmOrder->getFieldData('oxcurrency')}]',
|
'currency': '[{$_gtmOrder->getFieldData('oxcurrency')}]',
|
||||||
'items':
|
'items':
|
||||||
[
|
[
|
||||||
[{foreach from=$_gtmArticles item="_gtmArticle" name="gtmArticles"}]
|
[{foreach from=$_gtmArticles item="d3BasketArticle" name="gtmArticles"}]
|
||||||
|
[{assign var="d3oArticlePrice" value=$d3BasketArticle->getPrice()}]
|
||||||
{
|
{
|
||||||
'id': '[{$_gtmArticle->oxorderarticles__oxartnum->value}]',
|
'id': '[{$d3BasketArticle->getFieldData("oxartnum")}]',
|
||||||
'name': '[{$_gtmArticle->oxorderarticles__oxtitle->value}]',
|
'name': '[{$d3BasketArticle->getFieldData("oxtitle")}]',
|
||||||
'variant': '[{$_gtmArticle->oxorderarticles__oxselvariant->value}]',
|
'variant': '[{$d3BasketArticle->getFieldData("oxselvariant")}]',
|
||||||
'price': [{$_gtmArticle->oxorderarticles__oxprice->value}],
|
'price': [{$d3oArticlePrice->getPrice()}],
|
||||||
'quantity': [{$_gtmArticle->oxorderarticles__oxamount->value}],
|
'quantity': [{$d3BasketArticle->getFieldData("oxamount")}],
|
||||||
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
||||||
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
||||||
[{/foreach}]
|
[{/foreach}]
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
[{$smarty.block.parent}]
|
|
||||||
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
|
|
||||||
<script>
|
|
||||||
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->oxarticles__oxtitle->value}]',
|
|
||||||
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
|
||||||
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
|
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
26
Application/views/blocks/view_item.tpl
Normal file
26
Application/views/blocks/view_item.tpl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
||||||
|
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||||
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
|
|
||||||
|
<script>
|
||||||
|
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_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||||
|
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
|
||||||
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||||
|
'price': [{$d3PriceObject->getPrice()}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
@ -1,35 +0,0 @@
|
|||||||
[{$smarty.block.parent}]
|
|
||||||
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
<script>
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'ee.impression',
|
|
||||||
'eventLabel':'Impression',
|
|
||||||
'ecommerce': {
|
|
||||||
'currencyCode': '[{$currency->name}]',
|
|
||||||
'impressions': [
|
|
||||||
{
|
|
||||||
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
|
||||||
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value}],
|
|
||||||
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
|
||||||
'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]'
|
|
||||||
[{if $list && $position}],
|
|
||||||
'list': '[{$list}]',
|
|
||||||
'position': [{"_"|str_replace:"":$position}]
|
|
||||||
[{/if}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!--
|
|
||||||
sWidgetType [{$sWidgetType}] | [{$oView->getViewParameter('sWidgetType')}]
|
|
||||||
sListType [{$sListType}] | [{$oView->getViewParameter('sListType')}]
|
|
||||||
iIndex [{$iIndex}] | [{$oView->getIndex()}]
|
|
||||||
listId [{$listId}] | [{$oView->getViewParameter('listId')}]
|
|
||||||
testid [{$testid}] | [{$oView->getViewParameter('testid')}]
|
|
||||||
-->
|
|
@ -1,9 +1,13 @@
|
|||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
[{*$gtmProduct|get_class_methods|dumpvar*}]
|
[{assign var="d3ProductObject" value=$oView->getProduct()}]
|
||||||
|
[{assign var="d3PriceObject" value=$d3ProductObject->getPrice()}]
|
||||||
|
|
||||||
[{capture assign=d3_ga4_add_to_cart}]
|
[{capture assign=d3_ga4_add_to_cart}]
|
||||||
|
[{block name="d3_ga4_add_to_basket"}]
|
||||||
$("#toBasket").click(function(event) {
|
$("#toBasket").click(function(event) {
|
||||||
|
|
||||||
|
[{*** Debug cases ***}]
|
||||||
[{*event.preventDefault();*}]
|
[{*event.preventDefault();*}]
|
||||||
|
|
||||||
let iArtQuantity = $("#amountToBasket").val();
|
let iArtQuantity = $("#amountToBasket").val();
|
||||||
@ -14,31 +18,25 @@
|
|||||||
'eventLabel': 'add_to_cart',
|
'eventLabel': 'add_to_cart',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'currency': "[{$currency->name}]",
|
'currency': "[{$currency->name}]",
|
||||||
'value': iArtQuantity*[{$gtmProduct->getFieldData('oxprice')}],
|
'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
|
||||||
'items': [
|
'items': [
|
||||||
{
|
{
|
||||||
'item_id': '[{$gtmProduct->getFieldData('oxartnum')}]',
|
'item_id': '[{$gtmProduct->getFieldData('oxartnum')}]',
|
||||||
'item_name': '[{$gtmProduct->getFieldData('oxtitle')}]',
|
'item_name': '[{$gtmProduct->getFieldData('oxtitle')}]',
|
||||||
'price': '[{$gtmProduct->getFieldData('oxprice')}]',
|
'price': [{$d3PriceObject->getPrice()}],
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
'item_variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]',
|
'item_variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]',
|
||||||
'item_category': itemCategories[0] || 'no category',
|
'item_category': itemCategories[0] || 'no category',
|
||||||
'item_category_2':itemCategories[1] || '',
|
'item_category_2':itemCategories[1] || '',
|
||||||
'item_category_3':itemCategories[2] || '',
|
'item_category_3':itemCategories[2] || '',
|
||||||
'item_category_4':itemCategories[3] || '',
|
'item_category_4':itemCategories[3] || '',
|
||||||
[{if false}]
|
|
||||||
[{* ??? what *}]
|
|
||||||
'item_list_name': 'Search Results', // If associated with a list selection.
|
|
||||||
'item_list_id': 'SR123', // If associated with a list selection.
|
|
||||||
'index': 1, // If associated with a list selection.
|
|
||||||
[{/if}]
|
|
||||||
'quantity': iArtQuantity
|
'quantity': iArtQuantity
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
[{/block}]
|
||||||
[{/capture}]
|
[{/capture}]
|
||||||
[{oxscript add=$d3_ga4_add_to_cart}]
|
[{oxscript add=$d3_ga4_add_to_cart}]
|
||||||
|
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
[{strip}]
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.dataLayer = window.dataLayer || [];
|
|
||||||
dataLayer.push({ ecommerce: null });
|
|
||||||
dataLayer.push({
|
|
||||||
[{assign var="oBasket" value=$order->getBasket()}]
|
|
||||||
[{assign var="iVat" value=0}]
|
|
||||||
|
|
||||||
'event':'purchase',
|
|
||||||
'ecommerce':{
|
|
||||||
'purchase':{
|
|
||||||
'actionField':{
|
|
||||||
'id': [{$order->getFieldData('oxordernr')}],
|
|
||||||
'ordernr': [{$order->getFieldData('oxtotalordersum')}],
|
|
||||||
'tax': [{$order->d3GetSumOrderVat()}],
|
|
||||||
'shipping': [{$order->getFieldData('oxdelcost')}],
|
|
||||||
'currency': "[{$order->getFieldData('oxcurrency')}]"
|
|
||||||
},
|
|
||||||
'products':[
|
|
||||||
[{foreach from=$order->getOrderArticles() item=listItem}]
|
|
||||||
[{assign var="orderArticle" value=$listItem->getArticle()}]
|
|
||||||
{
|
|
||||||
'item_id': "[{$listItem->getFieldData('oxartnum')}]",
|
|
||||||
'item_name': "[{$listItem->getFieldData('oxtitle')}]",
|
|
||||||
'currency': "[{$order->getFieldData('oxcurrency')}]",
|
|
||||||
'articleVat': [{$orderArticle->getArticleVat()}],
|
|
||||||
'price': [{$orderArticle->getBasePrice()}],
|
|
||||||
'quantity': [{$listItem->getFieldData('oxamount')}]
|
|
||||||
},
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{/strip}]
|
|
@ -13,12 +13,13 @@
|
|||||||
'search_term': '[{$searchparamforhtml}]',
|
'search_term': '[{$searchparamforhtml}]',
|
||||||
'items': [
|
'items': [
|
||||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||||
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||||
{
|
{
|
||||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value|default:'0'}],
|
'price': [{$d3PriceObject->getPrice()}],
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||||
'quantity': 1
|
'quantity': 1
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
[{strip}]
|
|
||||||
[{* variable $gtmProduct is passed from parent tempalte *}]
|
|
||||||
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
<script type="text/javascript">
|
|
||||||
dataLayer.push({ecommerce: null});
|
|
||||||
dataLayer.push({
|
|
||||||
'event':'GA4_event',
|
|
||||||
'event_name': 'view_item',
|
|
||||||
'ecommerce': {
|
|
||||||
'items': [
|
|
||||||
{
|
|
||||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
|
||||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
|
||||||
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
|
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value|default:0}],
|
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
|
||||||
'quantity': '1'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{/strip}]
|
|
@ -1,34 +1,36 @@
|
|||||||
[{assign var="gtmProducts" value=$products}]
|
[{$smarty.block.parent}]
|
||||||
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||||
[{assign var="breadCrumb" value=''}]
|
|
||||||
|
[{assign var="breadCrumb" value=''}]
|
||||||
[{if $gtmProducts|@count}]
|
|
||||||
[{strip}]
|
[{if $gtmProducts|@count}]
|
||||||
<script>
|
[{strip}]
|
||||||
/* ga4 */
|
<script>
|
||||||
dataLayer.push({ecommerce: null});
|
/* ga4 */
|
||||||
dataLayer.push({
|
dataLayer.push({ecommerce: null});
|
||||||
'event':'view_item_list',
|
dataLayer.push({
|
||||||
'event_name': 'view_item_list',
|
'event':'view_item_list',
|
||||||
'ecommerce': {
|
'event_name': 'view_item_list',
|
||||||
'item_list_id': '[{$oView->getCategoryId()}]',
|
'ecommerce': {
|
||||||
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
'item_list_id': '[{$oView->getCategoryId()}]',
|
||||||
'items': [
|
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
||||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
'items': [
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||||
{
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
{
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value|default:'0'}],
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
'price': [{$d3PriceObject->getPrice()}],
|
||||||
'quantity': 1
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||||
[{/foreach}]
|
'quantity': 1
|
||||||
]
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||||
}
|
[{/foreach}]
|
||||||
});
|
]
|
||||||
</script>
|
}
|
||||||
[{/strip}]
|
});
|
||||||
|
</script>
|
||||||
|
[{/strip}]
|
||||||
[{/if}]
|
[{/if}]
|
120
CHANGELOG.md
120
CHANGELOG.md
@ -4,27 +4,109 @@ 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/MyModule/compare/1.1.0.0...rel_1.x)
|
## [2.6.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.5.0...2.6.0) - 2023-05-31
|
||||||
|
|
||||||
## [1.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2022-07-26
|
|
||||||
### Added
|
### Added
|
||||||
- another feature
|
- 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.5.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.4.0...1.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
|
||||||
|
|
||||||
|
## [1.4.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.3.1...1.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
|
||||||
|
|
||||||
|
## [1.3.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.2.1...1.3.1) - 2023-03-17
|
||||||
|
### Added
|
||||||
|
- Aggrosoft-Cookie-Consent compatibility
|
||||||
|
### Fixed
|
||||||
|
- wrong function for pageview on thankyou page
|
||||||
|
|
||||||
|
## [1.2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.2...1.2.1) - 2023-02-22
|
||||||
|
### Fixed
|
||||||
|
- price formatting in view_cart
|
||||||
|
|
||||||
|
## [1.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...1.2) - 2023-02-01
|
||||||
|
### Added
|
||||||
|
- own cookie-check-handler
|
||||||
|
|
||||||
|
## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27
|
||||||
|
### Added
|
||||||
|
- block section for add_to_basket js
|
||||||
|
- template block order positions
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- changed old code
|
- switched price formatting
|
||||||
|
|
||||||
### Deprecated
|
## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.0) - 2023-01-20
|
||||||
- ...
|
|
||||||
|
|
||||||
### Removed
|
|
||||||
- ...
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- ...
|
|
||||||
|
|
||||||
### Security
|
|
||||||
- ...
|
|
||||||
|
|
||||||
## [1.0.0.0](https://git.d3data.de/D3Public/MyModule/releases/tag/1.0.0.0) - 2022-07-25
|
|
||||||
### Added
|
### Added
|
||||||
- implemented features
|
- publication of app features
|
68
Docs/README.md
Normal file
68
Docs/README.md
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# Technische Doku
|
||||||
|
## 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.
|
||||||
|
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?
|
||||||
|
Kommen Sie auf uns zu unter https://www.d3data.de/
|
||||||
|
|
||||||
|
## 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 (muss hinzugefĂĽgt werden)
|
||||||
|
- 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
|
||||||
|
- 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
|
||||||
|
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
||||||
|
|
||||||
|
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
|
||||||
|
+ **page.type** - Seitentyp: default / cms / product / listing / checkout (an google analytics angelehnt)
|
||||||
|
+ **page.title** - Seitentitel (auĂźer Startseite, sie hat keinen Titel)
|
||||||
|
+ **page.cl** - OXID Controller Klasse (start, search, etc)
|
||||||
|
+ **userid** - oxId vom Benutzer bzw `false` falls nicht eingeloggt
|
||||||
|
+ **sessionid** - session iD
|
||||||
|
|
||||||
|
Alle fĂĽr Ecommerce Tracking relevanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
|
||||||
|
|
||||||
|
## Cookie-Handling
|
||||||
|
Sie nutzen einen eigenen, als Modul im Shop installierten, Cookie-manager?
|
||||||
|
Dann tragen Sie in den Folgeeinstellungen unter "Cookie Manager Einstellungen",
|
||||||
|
die Cookie-ID des zugehörigen Cookies ein.
|
||||||
|
Aktivieren Sie anschlieĂźend diese Weiche. Setzen Sie den Haken bei "Eigenen Cookie Manager nutzen?".
|
||||||
|
|
||||||
|
### UnterstĂĽtzung fĂĽr
|
||||||
|
- [aggrosoft - oxid-cookie-compliance](https://github.com/aggrosoft/oxid-cookie-compliance)
|
||||||
|
- https://github.com/aggrosoft/oxid-cookie-compliance
|
||||||
|
- die entsprechend gewählte Kategorie in den Moduleinstellungen des 'Google Analytics 4' unter
|
||||||
|
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||||
|
- Default-Werte sind entweder ```ANALYTICS``` oder ```MARKETING```. Bitte auf die GroĂźschreibung achten.
|
||||||
|
|
||||||
|
- [Netensio - Cookie Consent Manager](https://www.netensio.de/oxid-eshop-module/cookie-consent-manager-fuer-oxid-eshop.html)
|
||||||
|
- Modul entsprechend konfigurieren
|
||||||
|
- CookieID des angelegten Cookies in den Moduleinstellungen des 'Google Analytics 4' unter
|
||||||
|
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||||
|
|
||||||
|
- [OXID Cookie Management powered by usercentrics](https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html)
|
||||||
|
- In der Usercentrics-Verwaltung die Services "Google Analytics" und "Google Tag Manager" anlegen
|
||||||
|
- Den Service ```Google Tag Manager``` in den Moduleinstellungen des 'Google Analytics 4' unter
|
||||||
|
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
/*
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* vanilla-thunder/oxid-module-gtm
|
* file that was distributed with this source code.
|
||||||
* Google Tag Manager Integration for OXID eShop v6.2+
|
|
||||||
*
|
*
|
||||||
* This program is free software;
|
* https://www.d3data.de
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
* @link https://www.oxidmodule.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Core;
|
namespace D3\GoogleAnalytics4\Modules\Core;
|
||||||
|
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
||||||
|
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||||
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||||
|
use OxidEsales\Eshop\Core\Config;
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
|
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
|
||||||
@ -25,23 +25,138 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
|
|
||||||
// Google Tag Manager Container ID
|
// Google Tag Manager Container ID
|
||||||
private $sContainerId = null;
|
private $sContainerId = null;
|
||||||
|
private $sCookieManagerType = null;
|
||||||
|
|
||||||
public function getGtmContainerId()
|
public function getGtmContainerId()
|
||||||
{
|
{
|
||||||
if ($this->sContainerId === null)
|
if ($this->sContainerId === null)
|
||||||
{
|
{
|
||||||
$this->sContainerId = $this->getConfig()->getConfigParam('vt_gtm_sContainerID');
|
$this->sContainerId = ContainerFactory::getInstance()
|
||||||
|
->getContainer()
|
||||||
|
->get(ModuleSettingBridgeInterface::class)
|
||||||
|
->get('d3_gtm_sContainerID', 'd3googleanalytics4');
|
||||||
}
|
}
|
||||||
return $this->sContainerId;
|
return $this->sContainerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function defineCookieManagerType() :void
|
||||||
|
{
|
||||||
|
if ($this->sCookieManagerType === null)
|
||||||
|
{
|
||||||
|
/** @var ManagerHandler $oManagerHandler */
|
||||||
|
$oManagerHandler = oxNew(ManagerHandler::class);
|
||||||
|
$this->sCookieManagerType = $oManagerHandler->getCurrManager();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function shallUseOwnCookieManager() :bool
|
||||||
|
{
|
||||||
|
return (bool) Registry::getConfig()->getConfigParam('d3_gtm_settings_hasOwnCookieManager');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function D3blShowGtmScript()
|
||||||
|
{
|
||||||
|
/** @var Config $oConfig */
|
||||||
|
$oConfig = Registry::getConfig();
|
||||||
|
|
||||||
|
// No Cookie Manager in use
|
||||||
|
if (!$this->shallUseOwnCookieManager()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->defineCookieManagerType();
|
||||||
|
|
||||||
|
$sCookieID = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||||
|
|
||||||
|
// Netensio Cookie Manager
|
||||||
|
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
||||||
|
$oSession = Registry::getSession();
|
||||||
|
$aCookies = $oSession->getVariable("aCookieSel");
|
||||||
|
|
||||||
|
return (is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aggrosoft Cookie Consent
|
||||||
|
if ($this->sCookieManagerType === ManagerTypes::AGCOOKIECOMPLIANCE) {
|
||||||
|
if (method_exists($this, "isCookieCategoryEnabled")) {
|
||||||
|
return $this->isCookieCategoryEnabled($sCookieID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UserCentrics or consentmanager
|
||||||
|
if (
|
||||||
|
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
||||||
|
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
||||||
|
or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
|
||||||
|
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
|
||||||
|
)
|
||||||
|
{
|
||||||
|
// Always needs the script-tags delivered to the DOM.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cookie Manager not (yet) supported
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get additional attributes for script tags.
|
||||||
|
* This is especially important for UserCentrics.
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getGtmScriptAttributes() :string
|
||||||
|
{
|
||||||
|
$oConfig = Registry::getConfig();
|
||||||
|
$sCookieId = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||||
|
|
||||||
|
if (false === $this->shallUseOwnCookieManager()){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
||||||
|
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if ($sCookieId) {
|
||||||
|
return 'data-usercentrics="' . $sCookieId . '" type="text/plain" async=""';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
||||||
|
{
|
||||||
|
if ($sCookieId) {
|
||||||
|
return 'async
|
||||||
|
type="text/plain"
|
||||||
|
data-cmp-src="https://www.googletagmanager.com/gtm.js?id='.$this->getGtmContainerId().'"
|
||||||
|
class="cmplazyload"
|
||||||
|
data-cmp-vendor="s905"
|
||||||
|
';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
private $blGA4enabled = null;
|
private $blGA4enabled = null;
|
||||||
|
|
||||||
public function isGA4enabled()
|
public function isGA4enabled()
|
||||||
{
|
{
|
||||||
if ($this->blGA4enabled === null)
|
if ($this->blGA4enabled === null)
|
||||||
{
|
{
|
||||||
$this->sContainerId = $this->getConfig()->getConfigParam('vt_gtm_blEnableGA4');
|
$this->sContainerId = ContainerFactory::getInstance()
|
||||||
|
->getContainer()
|
||||||
|
->get(ModuleSettingBridgeInterface::class)
|
||||||
|
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->blGA4enabled;
|
return $this->blGA4enabled;
|
||||||
@ -54,10 +169,9 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
$oConfig = Registry::getConfig();
|
$oConfig = Registry::getConfig();
|
||||||
$oView = $oConfig->getTopActiveView();
|
$oView = $oConfig->getTopActiveView();
|
||||||
/** @var FrontendController $oShop */
|
/** @var FrontendController $oShop */
|
||||||
//$oShop = oxRegistry::getConfig()->getActiveShop(); /** @var oxShop $oShop */
|
|
||||||
$oUser = $oConfig->getUser();
|
$oUser = $oConfig->getUser();
|
||||||
|
|
||||||
$cl = $this->getTopActionClassName();
|
$cl = $this->getTopActiveClassName();
|
||||||
$aPageTypes = [
|
$aPageTypes = [
|
||||||
"content" => "cms",
|
"content" => "cms",
|
||||||
"details" => "product",
|
"details" => "product",
|
||||||
@ -68,6 +182,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
"payment" => "checkout",
|
"payment" => "checkout",
|
||||||
"order" => "checkout",
|
"order" => "checkout",
|
||||||
"thankyou" => "checkout",
|
"thankyou" => "checkout",
|
||||||
|
"start" => "start",
|
||||||
];
|
];
|
||||||
|
|
||||||
$dataLayer = [
|
$dataLayer = [
|
||||||
@ -81,38 +196,7 @@ class ViewConfig extends ViewConfig_parent
|
|||||||
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
||||||
];
|
];
|
||||||
|
|
||||||
#return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
|
||||||
|
|
||||||
unset($dataLayer["user"]["http"]); // das brauchen wir hier nicht
|
|
||||||
|
|
||||||
|
|
||||||
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
||||||
/*
|
|
||||||
// --- Produktdaten ---
|
|
||||||
$transactionProducts = [];
|
|
||||||
foreach($oOrder->getOrderArticles() as $_prod ) $transactionProducts[] = [
|
|
||||||
'name' => '', // (erforderlich) Produktname String
|
|
||||||
'sku' => '', // (erforderlich) Produkt-SKU String
|
|
||||||
'category' => '', // (optional) Produktkategorie String
|
|
||||||
'price' => '', // (erforderlich) Preis pro Einheit Numerischer Wert
|
|
||||||
'quantity' => '' // (erforderlich) Anzahl der Artikel Numerischer Wert
|
|
||||||
];
|
|
||||||
|
|
||||||
// --- Transaktionsdaten ---
|
|
||||||
|
|
||||||
$dataLayer['transactionId'] = $oOrder->oxorder__oxordernr->value; // (erforderlich) Eindeutige Transaktionskennung String
|
|
||||||
$dataLayer['transactionAffiliation'] = $oShop->oxshops__oxname->value; // (optional) Partner oder Geschäft String
|
|
||||||
$dataLayer['transactionTotal'] = $oOrder->oxorder__oxtotalordersum->value; // (erforderlich) Gesamtwert der Transaktion Numerischer Wert
|
|
||||||
$dataLayer['transactionShipping'] = $oOrder->oxorder__oxdelcost->value; // (optional) Versandkosten fĂĽr die Transaktion Numerischer Wert
|
|
||||||
$dataLayer['transactionTax'] = ''; // (optional) Steuerbetrag fĂĽr die Transaktion Numerischer Wert
|
|
||||||
$dataLayer['transactionProducts'] = $transactionProducts; // (optional) Liste der bei der Transaktion erworbenen Artikel Array von Produktobjekten
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
public function triggerGA4events()
|
|
||||||
{
|
|
||||||
// general events
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isPromotionList($listId)
|
public function isPromotionList($listId)
|
||||||
|
42
README.md
42
README.md
@ -20,35 +20,22 @@ WeiterfĂĽhrende Informationen: https://developers.google.com/analytics/devguides
|
|||||||
|
|
||||||
Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version.
|
Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version.
|
||||||
|
|
||||||
Bitte tragen Sie den folgenden Abschnitt in die `composer.json` Ihres Projektes ein:
|
|
||||||
|
|
||||||
```
|
|
||||||
"extra": {
|
|
||||||
"oxideshop": {
|
|
||||||
"blacklist-filter": [
|
|
||||||
"*.md",
|
|
||||||
"composer.json",
|
|
||||||
".php-cs-fixer.php",
|
|
||||||
"*.xml",
|
|
||||||
"*.neon"
|
|
||||||
],
|
|
||||||
"target-directory": "d3/googleanalytics"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Ă–ffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). FĂĽhren Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
|
Ă–ffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). FĂĽhren Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php composer require d3/google-analytics4:^1
|
php composer require d3/google-analytics4:^2
|
||||||
```
|
```
|
||||||
|
|
||||||
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
||||||
|
|
||||||
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
||||||
|
|
||||||
## Verwendung
|
### Wichtig!
|
||||||
|
Bitte stellen Sie sicher, dass die nötigen Template-Blöcke im OXID-Shop zur Verfügung stehen.
|
||||||
|
Lesen Sie mehr in der [technischen Doku](./Docs/README.md) unter "Blöcke"!
|
||||||
|
|
||||||
|
## Verwendung
|
||||||
|
### Grundfunktionalität
|
||||||
Nach erfolgreicher Installation finden Sie in Ihrem Shop-Admin unter "Erweiterungen > Module"
|
Nach erfolgreicher Installation finden Sie in Ihrem Shop-Admin unter "Erweiterungen > Module"
|
||||||
den Eintrag 'Google Analytics 4'.
|
den Eintrag 'Google Analytics 4'.
|
||||||
Aktivieren Sie dieses Modul, um die Funktionalitäten nutzen zu können.
|
Aktivieren Sie dieses Modul, um die Funktionalitäten nutzen zu können.
|
||||||
@ -58,11 +45,10 @@ Tragen Sie die nötige sog. 'Container ID' ein. Diese sieht in etwa so aus: 'GTM
|
|||||||
|
|
||||||
Aktivieren Sie GA4 selbst, indem Sie dieses direkt darunter anhaken.
|
Aktivieren Sie GA4 selbst, indem Sie dieses direkt darunter anhaken.
|
||||||
|
|
||||||
---
|
### Technische Infos
|
||||||
|
- Navigieren Sie bitte zur [technischen Doku](./Docs/README.md)
|
||||||
|
|
||||||
Sie nutzen einen eigenen, als Modul im Shop installierten, Cookie-manager? Dann tragen Sie in den Folgeeinstellungen
|
---
|
||||||
unter "Cookie Manager Einstellungen", die Cookie-ID des zugehörigen Cookies ein. Und aktivieren Sie diese Weiche,
|
|
||||||
indem Sie den Haken bei "Eigenen Cookie Manager nutzen?" setzen.
|
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
@ -89,8 +75,12 @@ Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
|||||||
Diese Software wird unter der GNU GENERAL PUBLIC LICENSE Version 3 vertrieben.
|
Diese Software wird unter der GNU GENERAL PUBLIC LICENSE Version 3 vertrieben.
|
||||||
```
|
```
|
||||||
|
|
||||||
Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [LICENSE](LICENSE.md)-Datei, die mit diesem Quellcode verteilt wurde.
|
Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [LICENSE](LICENSE)-Datei, die mit diesem Quellcode verteilt wurde.
|
||||||
|
|
||||||
## weitere Lizenzen und Nutzungsbedingungen
|
## Credits
|
||||||
|
Zu diesem Modul haben beigetragen:
|
||||||
|
|
||||||
...
|
- [Marat Bedoev](https://github.com/vanilla-thunder)
|
||||||
|
- [Christoph Stäblein [gn2]](https://github.com/reyneke-vosz)
|
||||||
|
|
||||||
|
Vielen Dank.
|
67
__README.md
67
__README.md
@ -1,67 +0,0 @@
|
|||||||
# [D3] Google Tag Manager
|
|
||||||
Google Tag Manager integration for OXID eShop v6.x
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
* ``composer require vanilla-thunder/oxid-module-gtm --no-update``
|
|
||||||
* Modul aktivieren und Moduleinstellungen konfigurieren
|
|
||||||
|
|
||||||
## Tag Manager konfigurieren:
|
|
||||||
+ https://support.google.com/tagmanager/answer/9442095
|
|
||||||
|
|
||||||
## Google Analytics 4 Einrichtung
|
|
||||||
|
|
||||||
## GA4 Events / Customizing
|
|
||||||
fĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/GoogleTagManager/Application/views/ga4/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
|
|
||||||
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/GoogleTagManager/Application/views/blocks/`.
|
|
||||||
|
|
||||||
### aktuell zu beachtende Blöcke
|
|
||||||
- Suchergebnisse: search_results
|
|
||||||
- (muss hinzugefĂĽgt werden) aList: d3Ga4_view_item_list
|
|
||||||
- Detailseite: details_productmain_title
|
|
||||||
- add_to_basket-button: details_productmain_tobasket
|
|
||||||
- Warenkorb: checkout_basket_main
|
|
||||||
- Purchase | abgeschlossener Kauf: checkout_thankyou_main
|
|
||||||
|
|
||||||
## Universal Analytics Events
|
|
||||||
|
|
||||||
**"EE-Trigger" fĂĽr Ecomemrce-Tags (Beispiel fĂĽr Google Tag Manager):**
|
|
||||||
+ Triggertyp: Benutzerdefiniertes Ereignis
|
|
||||||
+ Ereignisname: ``ee\..*``
|
|
||||||
+ Übereinstimmung mit regulärem Ausdruck verwenden
|
|
||||||
+ Diesen Trigger auslösen bei: Alle benutzerdefinierten Ereignisse
|
|
||||||
|
|
||||||
**"EE-Tag" fĂĽr Google Analytics Enhanced Ecommerce:**
|
|
||||||
+ Tag-Typ: Google Analytics - Universal Analytics
|
|
||||||
+ Tracking-Typ: Ereignis
|
|
||||||
+ Aktion: {{Event}}
|
|
||||||
+ Label: {{Event Label}}
|
|
||||||
+ Trigger : EE-Trigger
|
|
||||||
|
|
||||||
## VerfĂĽgbare Datalayer Variablen
|
|
||||||
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
|
||||||
|
|
||||||
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
|
|
||||||
+ **page.type** - Seitentyp: default / cms / product / listing / checkout (an google analytics angelehnt)
|
|
||||||
+ **page.title** - Seitentitel (auĂźer Startseite, sie hat keinen Titel. Danke OXID...)
|
|
||||||
+ **page.cl** - OXID Controller Klasse (start, search, etc)
|
|
||||||
+ **userid** - oxID vom Benutzer bzw `false` falls nicht eingeloggt
|
|
||||||
+ **sessionid** - session iD
|
|
||||||
|
|
||||||
Alle fĂĽr Ecommerce Tracking releavanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
|
|
||||||
Hier ist ein Beispiel fĂĽr die Einrichtung von Enhanced Ecomemrce Tracking ĂĽber Google Tag Manager:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### LICENSE AGREEMENT
|
|
||||||
[vt] google-tag-manager
|
|
||||||
Copyright (C) 2021 Marat Bedoev
|
|
||||||
info: info@mb-dev.pro oder so /** @todo: ĂĽberarbeiten, wenn ich wieder nĂĽchtern bin */
|
|
||||||
|
|
||||||
This program is free software;
|
|
||||||
you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
either version 3 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.1",
|
||||||
"oxid-esales/oxideshop-ce": "v6.0 - 6.3",
|
"oxid-esales/oxideshop-ce": "^6.5",
|
||||||
"google/apiclient":" ^2.0"
|
"google/apiclient":" ^2.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
106
metadata.php
106
metadata.php
@ -1,6 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
||||||
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
||||||
|
|
||||||
@ -19,7 +17,7 @@ $aModule = [
|
|||||||
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
||||||
",
|
",
|
||||||
'thumbnail' => 'thumbnail.png',
|
'thumbnail' => 'thumbnail.png',
|
||||||
'version' => '1.0.0.0',
|
'version' => '2.6.0',
|
||||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
@ -28,36 +26,17 @@ $aModule = [
|
|||||||
],
|
],
|
||||||
'templates' => [
|
'templates' => [
|
||||||
// GA4 events
|
// GA4 events
|
||||||
'ga4_add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_payment_info.tpl',
|
|
||||||
'add_shipping_info.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_shipping_info.tpl',
|
|
||||||
'ga4_add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl',
|
'ga4_add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl',
|
||||||
'ga4_begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/ga4/begin_checkout.tpl',
|
|
||||||
'ga4_generate_lead.tpl' => 'd3/googleanalytics4/Application/views/ga4/generate_lead.tpl',
|
|
||||||
'ga4_login.tpl' => 'd3/googleanalytics4/Application/views/ga4/login.tpl',
|
|
||||||
'ga4_purchase.tpl' => 'd3/googleanalytics4/Application/views/ga4/purchase.tpl',
|
|
||||||
'ga4_remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/remove_from_cart.tpl',
|
|
||||||
'ga4_search.tpl' => 'd3/googleanalytics4/Application/views/ga4/search.tpl',
|
'ga4_search.tpl' => 'd3/googleanalytics4/Application/views/ga4/search.tpl',
|
||||||
'ga4_select_content.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_content.tpl',
|
|
||||||
'ga4_select_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_item.tpl',
|
|
||||||
'ga4_select_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_promotion.tpl',
|
|
||||||
'ga4_sign_up.tpl' => 'd3/googleanalytics4/Application/views/ga4/sign_up.tpl',
|
|
||||||
'ga4_view_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_cart.tpl',
|
|
||||||
'ga4_view_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item.tpl',
|
|
||||||
'ga4_view_item_list.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item_list.tpl',
|
'ga4_view_item_list.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item_list.tpl',
|
||||||
'ga4_view_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_promotion.tpl',
|
|
||||||
/*
|
|
||||||
'gtm_ua_impression' => 'vt/GoogleTagManager/Application/views/ua/impression.tpl'
|
|
||||||
'gtm_view_promotion.tpl' => 'vt/GoogleTagManager/Application/views/view_promotion.tpl',
|
|
||||||
'gtm_select_promotion.tpl' => 'vt/GoogleTagManager/Application/views/select_promotion.tpl',
|
|
||||||
'gtm_begin_checkout.tpl' => 'vt/GoogleTagManager/Application/views/begin_checkout.tpl',
|
|
||||||
*/
|
|
||||||
],
|
],
|
||||||
'blocks' => [
|
'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
|
||||||
],
|
],
|
||||||
// tag manager nojs
|
// tag manager nojs
|
||||||
[
|
[
|
||||||
@ -65,23 +44,11 @@ $aModule = [
|
|||||||
'block' => 'theme_svg_icons',
|
'block' => 'theme_svg_icons',
|
||||||
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
||||||
],
|
],
|
||||||
// add to cart
|
|
||||||
[
|
|
||||||
'template' => 'layout/header.tpl',
|
|
||||||
'block' => 'header_main',
|
|
||||||
'file' => '/Application/views/blocks/add_to_cart.tpl'
|
|
||||||
],
|
|
||||||
// widget_product_list
|
|
||||||
[
|
|
||||||
'template' => 'widget/product/list.tpl',
|
|
||||||
'block' => 'widget_product_list',
|
|
||||||
'file' => '/Application/views/blocks/widget_product_list.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/detail.tpl',
|
'file' => '/Application/views/blocks/view_item.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
// checkout
|
// checkout
|
||||||
@ -90,31 +57,6 @@ $aModule = [
|
|||||||
'block' => 'checkout_basket_main',
|
'block' => 'checkout_basket_main',
|
||||||
'file' => '/Application/views/blocks/checkout_s1.tpl'
|
'file' => '/Application/views/blocks/checkout_s1.tpl'
|
||||||
],
|
],
|
||||||
[
|
|
||||||
'template' => 'form/user_checkout_change.tpl',
|
|
||||||
'block' => 'user_checkout_change',
|
|
||||||
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'template' => 'form/user_checkout_register.tpl',
|
|
||||||
'block' => 'user_checkout_register',
|
|
||||||
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'template' => 'form/user_checkout_noregister.tpl',
|
|
||||||
'block' => 'user_checkout_noregister',
|
|
||||||
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'template' => 'page/checkout/payment.tpl',
|
|
||||||
'block' => 'checkout_payment_main',
|
|
||||||
'file' => '/Application/views/blocks/checkout_s3.tpl'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'template' => 'page/checkout/order.tpl',
|
|
||||||
'block' => 'checkout_order_main',
|
|
||||||
'file' => '/Application/views/blocks/checkout_s4.tpl'
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/thankyou.tpl',
|
'template' => 'page/checkout/thankyou.tpl',
|
||||||
'block' => 'checkout_thankyou_main',
|
'block' => 'checkout_thankyou_main',
|
||||||
@ -123,58 +65,68 @@ $aModule = [
|
|||||||
// Lists
|
// Lists
|
||||||
// view_item_list
|
// view_item_list
|
||||||
[
|
[
|
||||||
'template' => 'widget/product/list.tpl',
|
'template' => 'page/list/list.tpl',
|
||||||
'block' => 'd3Ga4_view_item_list',
|
'block' => 'page_list_productlist',
|
||||||
'file' => '/Application/views/ga4/view_item_list.tpl'
|
'file' => '/Application/views/ga4/view_item_list.tpl',
|
||||||
|
'position' => 150
|
||||||
],
|
],
|
||||||
// view_search_result
|
// view_search_result
|
||||||
[
|
[
|
||||||
'template' => 'page/search/search.tpl',
|
'template' => 'page/search/search.tpl',
|
||||||
'block' => 'search_results',
|
'block' => 'search_results',
|
||||||
'file' => '/Application/views/ga4/search.tpl'
|
'file' => '/Application/views/ga4/search.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/ga4/add_to_cart.tpl',
|
||||||
|
'position' => 150
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'settings' => [
|
'settings' => [
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings',
|
||||||
'name' => 'vt_gtm_sContainerID',
|
'name' => 'd3_gtm_sContainerID',
|
||||||
'type' => 'str',
|
'type' => 'str',
|
||||||
'value' => 'GTM-',
|
'value' => 'GTM-',
|
||||||
'position' => 0
|
'position' => 0
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings',
|
||||||
'name' => 'vt_gtm_blGA4enab',
|
'name' => 'd3_gtm_blGA4enab',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => true,
|
'value' => true,
|
||||||
'position' => 1
|
'position' => 1
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings',
|
||||||
'name' => 'vt_gtm_blEnableDebug',
|
'name' => 'd3_gtm_blEnableDebug',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => false,
|
'value' => false,
|
||||||
'position' => 999
|
'position' => 999
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings_cookiemanager',
|
'group' => 'd3_gtm_settings_cookiemanager',
|
||||||
'name' => 'vt_gtm_settings_hasOwnCookieManager',
|
'name' => 'd3_gtm_settings_hasOwnCookieManager',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => false,
|
'value' => false,
|
||||||
'position' => 999
|
'position' => 999
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings_cookiemanager',
|
'group' => 'd3_gtm_settings_cookiemanager',
|
||||||
'name' => 'vt_gtm_settings_cookieName',
|
'name' => 'd3_gtm_settings_cookieName',
|
||||||
'type' => 'str',
|
'type' => 'str',
|
||||||
'value' => 'example',
|
'value' => 'example',
|
||||||
'position' => 999
|
'position' => 999
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'group' => 'd3_gtm_settings_cookiemanager',
|
||||||
|
'name' => 'd3_gtm_settings_HAS_STD_MANAGER',
|
||||||
|
'type' => 'select',
|
||||||
|
'value' => 'none',
|
||||||
|
'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS',
|
||||||
|
],
|
||||||
]
|
]
|
||||||
];
|
];
|
Reference in New Issue
Block a user