Compare commits
187 Commits
Author | SHA1 | Date |
---|---|---|
MaxBUhe | 8a643a0b8a | |
MaxBUhe | 7d23204841 | |
MaxBUhe | 9410495a58 | |
MaxBUhe | 05df5ef100 | |
MaxBUhe | c7d3671265 | |
MaxBUhe | 3621ca606a | |
MaxBUhe | 59ef1d0625 | |
MaxBUhe | e4969f2cbd | |
MaxBUhe | 13ef2bef7b | |
MaxBUhe | 59f0e37cce | |
MaxBUhe | bcf38a6e11 | |
MaxBUhe | 31b3474cfd | |
MaxBUhe | 1a641de8fc | |
MaxBUhe | 268cf6f6da | |
MaxBUhe | 5d5b3459cd | |
MaxBUhe | 1c1080923b | |
MaxBUhe | 007e83909b | |
MaxBUhe | e3f4bd16c9 | |
MaxBUhe | ed5fcc6011 | |
MaxBUhe | 22ea5a1ce2 | |
MaxBUhe | 229cf3695f | |
MaxBUhe | a990834da4 | |
MaxBUhe | 6047f72edf | |
MaxBUhe | e2564f613a | |
MaxBUhe | 9ea5408e44 | |
MaxBUhe | ab6b7f7454 | |
MaxBUhe | a88fa570a8 | |
MaxBUhe | 81aab10c4e | |
MaxBUhe | 5ac3385b53 | |
MaxBUhe | 42618fef79 | |
MaxBUhe | f02c40cfb7 | |
MaxBUhe | 5c98d99d80 | |
MaxBUhe | 19553fcee2 | |
MaxBUhe | da2966626e | |
MaxBUhe | 6fcee0671f | |
MaxBUhe | bb513e6ded | |
MaxBUhe | f64eb35763 | |
MaxBUhe | 36b3aa9ef2 | |
MaxBUhe | b2d8d597fd | |
MaxBUhe | 36ac641233 | |
MaxBUhe | ef4e4625cd | |
MaxBUhe | 84a9aba764 | |
MaxBUhe | 154147b8d8 | |
MaxBUhe | 99af4cdfa9 | |
MaxBUhe | eb2c7f73b9 | |
MaxBUhe | 7d12dd68a7 | |
MaxBUhe | 565f47b1ff | |
MaxBUhe | 7c6b0215a5 | |
Markus Gärtner | 84e3895db8 | |
MaxBUhe | 1e479503a7 | |
MaxBUhe | 575e35ffbc | |
MaxBUhe | 2e6acbe675 | |
MaxBUhe | aae6c43786 | |
MaxBUhe | 17840d33b1 | |
MaxBUhe | a49c29d7aa | |
MaxBUhe | e90aba2c55 | |
MaxBUhe | ea6b63fd2f | |
MaxBUhe | 6b18c50b42 | |
MaxBUhe | 443b456a0d | |
MaxBUhe | 216c53fa90 | |
MaxBUhe | 9e7b4653ea | |
MaxBUhe | 7b1241ab97 | |
Markus Gärtner | 5355b0a7ad | |
MaxBUhe | 0f15df8364 | |
MaxBUhe | 71b743ddcc | |
MaxBUhe | c0206f741f | |
MaxBUhe | 22bec30621 | |
MaxBUhe | 43cdc7e8ae | |
MaxBUhe | 49bfd5be09 | |
MaxBUhe | 6002540268 | |
MaxBUhe | cc89303595 | |
MaxBUhe | 7062d935f4 | |
MaxBUhe | 9f1deab099 | |
MaxBUhe | 461f7f15da | |
MaxBUhe | 4f8fa7cdc9 | |
MaxBUhe | 2cc0368633 | |
MaxBUhe | 432ba54c84 | |
MaxBUhe | 8b344ffb85 | |
MaxBUhe | 0009926313 | |
MaxBUhe | 50be757355 | |
MaxBUhe | b0a1c20419 | |
MaxBUhe | 54fcbf88c9 | |
MaxBUhe | 0ae67c823b | |
MaxBUhe | ab4232fb4a | |
MaxBuhe01 | 60f61f4bab | |
MaxBuhe01 | a93b1cf582 | |
MaxBUhe | 0ec765955e | |
MaxBUhe | d505d8530a | |
MaxBUhe | fd79710158 | |
MaxBUhe | d2ef663dd3 | |
MaxBUhe | fec30b1109 | |
MaxBUhe | 5c53d83f32 | |
MaxBUhe | 8a7c25fad9 | |
MaxBUhe | 429069e0cf | |
MaxBUhe | 50f9fbca23 | |
MaxBUhe | cb18feba82 | |
MaxBUhe | 47b8622018 | |
MaxBUhe | 92a91d0194 | |
MaxBUhe | 226a80f138 | |
MaxBUhe | 5dd7b51fb5 | |
MaxBUhe | 7b82476e8b | |
MaxBUhe | bfc2ca8ad6 | |
MaxBUhe | 7266416fe4 | |
MaxBUhe | 389d4f44ed | |
MaxBUhe | e48b21022c | |
MaxBUhe | b4bf91660e | |
MaxBUhe | 3f59d1f210 | |
MaxBUhe | 5ed924e840 | |
MaxBUhe | 3d62993dfc | |
MaxBUhe | 41d6e94fa7 | |
MaxBUhe | b8e2aeaa58 | |
MaxBUhe | 679a49823c | |
MaxBUhe | 106fea9c91 | |
MaxBUhe | d4ef0f35f9 | |
MaxBUhe | c17ae1cef5 | |
MaxBUhe | 13132e6da0 | |
MaxBUhe | 5c478124bc | |
MaxBUhe | 12613357b3 | |
MaxBUhe | 95e0cab68c | |
MaxBUhe | 1d194d445a | |
MaxBUhe | bf3fee5ce5 | |
MaxBUhe | 3c280a3adb | |
MaxBUhe | 6217524828 | |
MaxBUhe | 5ef600ff2a | |
MaxBUhe | a40d922f42 | |
MaxBUhe | dae5f66f81 | |
MaxBUhe | 32e08a88ca | |
MaxBUhe | 9d9daf9a85 | |
MaxBUhe | 6eefc062ba | |
MaxBUhe | 3f89e26bde | |
MaxBUhe | e624cfdfcb | |
MaxBUhe | e2cdda530b | |
MaxBUhe | 3e65d05c0b | |
MaxBUhe | 561a2101f1 | |
MaxBUhe | 6fca52cc06 | |
MaxBUhe | 347e551194 | |
MaxBUhe | 000c49c56b | |
MaxBUhe | 002cc69d2a | |
MaxBUhe | af78809ae5 | |
MaxBUhe | d531ba648b | |
MaxBUhe | a0c650fca3 | |
MaxBUhe | af341a984b | |
MaxBUhe | 122dd4cf53 | |
MaxBUhe | 27798703b0 | |
Christoph Staeblein | 8eb734be8a | |
MaxBUhe | 616f31ecba | |
MaxBUhe | 527eec1355 | |
MaxBUhe | 1966d3008e | |
MaxBUhe | bd51b37159 | |
MaxBuhe01 | 718b60e12c | |
MaxBuhe01 | d4df87bfff | |
MaxBUhe | 63007e9b02 | |
MaxBUhe | 5fe656988c | |
MaxBUhe | 9cb3a54824 | |
MaxBUhe | 2f6fd8a31c | |
MaxBUhe | 8f9ed021d6 | |
MaxBUhe | 0ef3d3373a | |
MaxBUhe | fd2b4a5bbe | |
MaxBuhe01 | 1c0d55bdc3 | |
MaxBuhe01 | 7c1f99e678 | |
MaxBUhe | 126e746651 | |
MaxBuhe01 | 1c45a16356 | |
MaxBUhe | 1589f202a9 | |
MaxBUhe | 55bd7b7fb4 | |
MaxBUhe | 3c1e6a11ff | |
MaxBUhe | 9ac78a0d43 | |
MaxBUhe | e2bcb34051 | |
MaxBUhe | 4ea0c19d7b | |
MaxBUhe | 56740f1f10 | |
MaxBUhe | daed30a585 | |
MaxBUhe | 48d411ac3f | |
MaxBUhe | b530366cb8 | |
MaxBUhe | 975d07056a | |
MaxBUhe | 24bf113d30 | |
MaxBUhe | ca6a810fa3 | |
MaxBUhe | 62b382eadf | |
MaxBUhe | 45d8e45137 | |
MaxBUhe | 70f2308575 | |
MaxBUhe | 6eb15ec080 | |
MaxBUhe | d722c46a74 | |
MaxBUhe | d847a34e99 | |
MaxBUhe | 7b55d1d57c | |
MaxBUhe | a25be1069c | |
MaxBUhe | 5200232a32 | |
MaxBUhe | bcd785774b | |
MaxBUhe | 5ba613df30 | |
MaxBUhe | a1dc0a6a58 |
|
@ -0,0 +1 @@
|
|||
.idea
|
|
@ -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";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
<?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";
|
||||
|
||||
const COOKIEFIRST = "COOKIEFIRST";
|
||||
|
||||
const COOKIEBOT = "COOKIEBOT";
|
||||
|
||||
/**
|
||||
* @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,
|
||||
"cookiefirst" => self::COOKIEFIRST,
|
||||
"cookiebot" => self::COOKIEBOT,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sManager
|
||||
* @return bool
|
||||
*/
|
||||
public function isManagerInList(string $sManager) :bool
|
||||
{
|
||||
return in_array($sManager, $this->getManagerList(), true);
|
||||
}
|
||||
}
|
|
@ -31,8 +31,23 @@ $aLang = [
|
|||
// for cookie manager settings
|
||||
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
||||
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Cookie Manager nutzen?',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_CONSENTMANAGER' => 'Nutzen Sie die Consentmanager-Einbindung?',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_CONSENTMANAGER_NO' => 'Nein',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_CONSENTMANAGER_YES' => 'Ja',
|
||||
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'CookieID',
|
||||
'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>
|
||||
<a href="https://consentmanager.net/">Consentmanager</a><br>
|
||||
<a href="https://usercentrics.com/">Usercentrics</a><br>
|
||||
<a href="https://cookiefirst.com">Cookiefirst</a><br>
|
||||
<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>',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?<br>
|
||||
Dann wählen Sie bitte die zutreffende aus.',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_NONE' => '---',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
|
||||
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
|
||||
'SHOP_MODULE_d3_gtm_settings_controlParameter' => 'Steuerungsparameter',
|
||||
'HELP_SHOP_MODULE_d3_gtm_settings_controlParameter' => 'Nähere infos zum <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs">"<strong>Steuerungsparameter</strong>"</a><hr>
|
||||
<strong>Beachte:</strong><br>
|
||||
Sofern Sie die <a target="_blank" href="https://consentmanager.net" style="color: blue">consentmanager</a> CMP verwenden,
|
||||
bitte ich Sie, grĂĽndlichst, die Hinweise der <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md">Moduldokumentation/Consentmanager</a> zu lesen.
|
||||
'
|
||||
];
|
||||
|
|
|
@ -4,28 +4,22 @@
|
|||
</script>
|
||||
|
||||
[{if $oViewConf->D3blShowGtmScript()}]
|
||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||
<!-- Google Tag Manager -->
|
||||
<script [{$oViewConf->getGtmScriptAttributes()}]>
|
||||
(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 -->
|
||||
|
||||
[{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}]
|
||||
[{if $oViewConf->getGtmContainerId()}]
|
||||
[{strip}]
|
||||
<!-- Google Tag Manager -->
|
||||
<script [{$oViewConf->getGtmScriptAttributes()}]>
|
||||
(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 -->
|
||||
[{/strip}]
|
||||
[{/if}]
|
||||
[{/if}]
|
||||
|
||||
[{$smarty.block.parent}]
|
|
@ -1,4 +1,4 @@
|
|||
[{if $oViewConf->D3blShowGtmScript() && !$oViewConf->getCookieManagerType()}]
|
||||
[{if $oViewConf->D3blShowGtmScript()}]
|
||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript>
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||
|
||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||
|
||||
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
||||
[{strip}][{capture assign=d3_ga4_view_cart}]
|
||||
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()}],
|
||||
'items': [
|
||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
||||
{
|
||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||
'price': [{$d3oItemPrice->getPrice()}],
|
||||
'quantity':[{$basketitem->getAmount()}],
|
||||
'position':[{$smarty.foreach.gtmCartContents.index}]
|
||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}
|
||||
});
|
||||
[{/capture}][{/strip}]
|
||||
[{oxscript add=$d3_ga4_view_cart}]
|
|
@ -1,36 +0,0 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{strip}]
|
||||
<script>
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
[{assign var="_gtmOrder" value=$oView->getOrder()}]
|
||||
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}]
|
||||
|
||||
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')}]',
|
||||
'items':
|
||||
[
|
||||
[{foreach from=$_gtmArticles item="d3BasketArticle" name="gtmArticles"}]
|
||||
[{assign var="d3oArticlePrice" value=$d3BasketArticle->getPrice()}]
|
||||
{
|
||||
'id': '[{$d3BasketArticle->getFieldData("oxartnum")}]',
|
||||
'name': '[{$d3BasketArticle->getFieldData("oxtitle")}]',
|
||||
'variant': '[{$d3BasketArticle->getFieldData("oxselvariant")}]',
|
||||
'price': [{$d3oArticlePrice->getPrice()}],
|
||||
'quantity': [{$d3BasketArticle->getFieldData("oxamount")}],
|
||||
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
||||
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}
|
||||
})
|
||||
</script>
|
||||
[{/strip}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/purchase.tpl"}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/remove_from_cart.tpl"}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_cart.tpl"}]
|
|
@ -1,26 +1,3 @@
|
|||
[{$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>
|
||||
[{include file="event/view_item.tpl"}]
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_item_list.tpl"}]
|
|
@ -0,0 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_search_result.tpl"}]
|
|
@ -0,0 +1,61 @@
|
|||
|
||||
[{if $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')}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'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}]
|
|
@ -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}]
|
||||
'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=$smarty.capture.d3_ga4_purchase}]
|
||||
[{/block}]
|
|
@ -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}]
|
||||
'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': '[{$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}]
|
|
@ -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}]
|
||||
'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=$smarty.capture.d3_ga4_view_cart}]
|
||||
[{/block}]
|
|
@ -0,0 +1,41 @@
|
|||
[{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()}]
|
||||
'price': [{$d3PriceObject->getPrice()}]
|
||||
}
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
|
||||
[{/block}]
|
|
@ -0,0 +1,45 @@
|
|||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
|
||||
|
||||
[{assign var="breadCrumb" value=''}]
|
||||
|
||||
[{block name="d3_ga4_view_item_list_block"}]
|
||||
[{if $gtmProducts|@count}]
|
||||
[{capture name="d3_ga4_view_item_list"}]
|
||||
[{strip}]
|
||||
dataLayer.push({ecommerce: null});
|
||||
dataLayer.push({
|
||||
'event':'view_item_list',
|
||||
'event_name': 'view_item_list',
|
||||
'ecommerce': {
|
||||
'item_list_id': '[{$oView->getCategoryId()}]',
|
||||
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
||||
'items': [
|
||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||
{
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'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)}]',
|
||||
[{/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_item_list}]
|
||||
[{/if}]
|
||||
[{/block}]
|
|
@ -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")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'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,56 +0,0 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{assign var="d3ProductObject" value=$oView->getProduct()}]
|
||||
[{assign var="d3PriceObject" value=$d3ProductObject->getPrice()}]
|
||||
|
||||
[{capture assign=d3_ga4_add_to_cart}]
|
||||
[{block name="d3_ga4_add_to_basket"}]
|
||||
$("#toBasket").click(function(event) {
|
||||
|
||||
[{*** 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}]',
|
||||
'item_category': itemCategories[0] || 'no category',
|
||||
'item_category_2':itemCategories[1] || '',
|
||||
'item_category_3':itemCategories[2] || '',
|
||||
'item_category_4':itemCategories[3] || '',
|
||||
'quantity': iArtQuantity
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
});
|
||||
[{/block}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_add_to_cart}]
|
||||
|
||||
[{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>
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
|
||||
let itemCategories = '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]'.split('/');
|
||||
|
||||
</script>
|
||||
[{/strip}]
|
|
@ -1,33 +0,0 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||
|
||||
[{if $gtmProducts|@count}]
|
||||
[{strip}]
|
||||
<script>
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'event': 'view_search_result',
|
||||
'eventLabel':'view_search_result',
|
||||
'ecommerce': {
|
||||
'search_term': '[{$searchparamforhtml}]',
|
||||
'items': [
|
||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||
{
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||
'quantity': 1
|
||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[{/strip}]
|
||||
[{/if}]
|
|
@ -1,36 +0,0 @@
|
|||
[{$smarty.block.parent}]
|
||||
[{assign var="gtmProducts" value=$products}]
|
||||
|
||||
[{assign var="breadCrumb" value=''}]
|
||||
|
||||
[{if $gtmProducts|@count}]
|
||||
[{strip}]
|
||||
<script>
|
||||
/* ga4 */
|
||||
dataLayer.push({ecommerce: null});
|
||||
dataLayer.push({
|
||||
'event':'view_item_list',
|
||||
'event_name': 'view_item_list',
|
||||
'ecommerce': {
|
||||
'item_list_id': '[{$oView->getCategoryId()}]',
|
||||
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
||||
'items': [
|
||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||
{
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||
'quantity': 1
|
||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[{/strip}]
|
||||
[{/if}]
|
|
@ -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"}]
|
||||
|
|
@ -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"}]
|
212
CHANGELOG.md
212
CHANGELOG.md
|
@ -4,6 +4,218 @@ 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/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [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.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
|
||||
### Added
|
||||
- extended Docs
|
||||
### Changed
|
||||
- control-param name
|
||||
- control-param function
|
||||
- adjusted check for set control-param
|
||||
- consentmanager-script-adjustments
|
||||
|
||||
## [1.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.1...1.12.0) - 2023-09-07
|
||||
### Added
|
||||
- cookiebot functionality
|
||||
|
||||
## [1.11.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.0...1.11.1) - 2023-08-17
|
||||
### Fixed
|
||||
- metadata class entry
|
||||
|
||||
## [1.11.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.10.0...1.11.0) - 2023-08-16
|
||||
### Added
|
||||
- remove_from_cart
|
||||
- auto debug_mode setter
|
||||
- manufacturer extension for breadcrumb
|
||||
### Changed
|
||||
- general template cleanup
|
||||
|
||||
## [1.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.9.0...1.10.0) - 2023-06-27
|
||||
### Added
|
||||
- Following Entries to dedicated event-templates
|
||||
- coupon
|
||||
- paymentType
|
||||
- item_list_name
|
||||
- item_category
|
||||
- Method to get the in order used Payment-Name
|
||||
- Method to get the current Article Category
|
||||
### Changed
|
||||
- cookieManager handling
|
||||
- general template cleanup
|
||||
- renaming the template to a more intuitive name
|
||||
|
||||
## [1.9.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.8.0...1.9.0) - 2023-06-19
|
||||
### Changed
|
||||
- add_to_cart event template-structure
|
||||
|
||||
## [1.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.7.0...1.8.0) - 2023-05-31
|
||||
### Fixed
|
||||
- bug in explicit manager selection
|
||||
|
||||
## [1.7.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.6.0...1.7.0) - 2023-05-31
|
||||
### Added
|
||||
- extended call to read the technical documentation
|
||||
### Changed
|
||||
- block-extension for view_item_list
|
||||
- way of getting list-articles in view_item_list
|
||||
|
||||
## [1.6.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.5.0...1.6.0) - 2023-05-30
|
||||
### Added
|
||||
- possibility to choose between consentmanager && usercentrics
|
||||
- position to block extension
|
||||
### Changed
|
||||
- genuine code cleanup
|
||||
- usercentrics includation script
|
||||
|
||||
## [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
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
# Consentmanager
|
||||
## 1. Steuerungsparameter
|
||||
Tragen Sie hier die gewĂĽnschte ID des zu prĂĽfenden Anbieters (Vendor-ID) ein.<br>
|
||||
Diese ID finden Sie in Ihrem Consentmanager-Dashboard, links, unter "CMP > Anbieter".
|
||||
|
||||
Nähere Informationen hierzu suchen Sie bitte auf der offiziellen Webseite von [app.consentmanager](https://help.consentmanager.de/books/cmp/page/4-configuring-vendors-and-cookies).
|
||||
|
||||
## 2. Gebräuchliche ID's
|
||||
- s26 (Google Analytics/ GA/ GA4)
|
||||
- s905 (Google Tag Manager/ GTM)
|
||||
|
||||
## 3. Einrichtung GTM
|
||||
Die von Ihnen eingetragene ID muss oder ist schlussendlich die ID, auf die im GTM-Umfeld geprĂĽft wird.
|
||||
Das heiĂźt, dass sich die Eintragung nach GTM, oder umgekehrt, richtet.
|
||||
|
||||
### Unterstützung benötigt?
|
||||
Kein Problem!
|
||||
Kontaktieren Sie uns gern unter [d3data.de](https://www.d3data.de)
|
|
@ -1,36 +1,16 @@
|
|||
# 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.
|
||||
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/`.
|
||||
*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: d3Ga4_view_item_list (muss hinzugefĂĽgt werden)
|
||||
- Datei: widget/product/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
|
||||
## Steuerungsparameter
|
||||
Tragen Sie hier im Normalfall die ID des zu prĂĽfenden Cookies ein.
|
||||
In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt
|
||||
nach der gewählten CMP (Consent Manager Platform).
|
||||
|
||||
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
|
||||
|
||||
## VerfĂĽgbare Datalayer Variablen
|
||||
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
||||
|
@ -50,6 +30,9 @@ Dann tragen Sie in den Folgeeinstellungen unter "Cookie Manager Einstellungen",
|
|||
die Cookie-ID des zugehörigen Cookies ein.
|
||||
Aktivieren Sie anschlieĂźend diese Weiche. Setzen Sie den Haken bei "Eigenen Cookie Manager nutzen?".
|
||||
|
||||
## Consent Manager Platform (CMP)
|
||||
- [Consentmanager](https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md)
|
||||
|
||||
### UnterstĂĽtzung fĂĽr
|
||||
- [aggrosoft - oxid-cookie-compliance](https://github.com/aggrosoft/oxid-cookie-compliance)
|
||||
- https://github.com/aggrosoft/oxid-cookie-compliance
|
||||
|
@ -63,6 +46,20 @@ Aktivieren Sie anschlieĂźend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
|||
```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 einen Service fĂĽr Google Analytics anlegen
|
||||
- Den Service-Namen in den Moduleinstellungen des 'Google Analytics 4' unter
|
||||
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||
- 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
|
||||
Google Tag Manager eintragen
|
||||
|
||||
- [Consent Management Provider](https://www.consentmanager.net/)
|
||||
- In der Consentmanager-Oberfläche den Anbieter "Google Tag Manager" mit der ID s905 hinzufügen
|
||||
- Im Frontend, im consentmanager-Pop-up nach dem 'Google Tag Manager' suchen
|
||||
- kleines Fragezeichen neben den Namen anklicken und ganz runter scrollen
|
||||
- prĂĽfen, ob ein Cookie vorgegeben ist
|
||||
- sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter
|
||||
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||
|
||||
- [Cookiefirst](https://cookiefirst.com)
|
||||
- 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
|
|
@ -15,4 +15,54 @@
|
|||
|
||||
namespace D3\GoogleAnalytics4\Modules\Core{
|
||||
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig{}
|
||||
}
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
||||
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
|
||||
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
||||
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {}
|
||||
}
|
||||
|
||||
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 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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
use OxidEsales\Eshop\Application\Component\BasketComponent;
|
||||
use OxidEsales\Eshop\Application\Model\Article;
|
||||
use OxidEsales\Eshop\Application\Model\ArticleList;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use oxSystemComponentException;
|
||||
|
||||
class BasketController extends BasketController_parent
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$return = parent::render();
|
||||
|
||||
$this->d3GA4getRemovedArticlesListObject();
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws oxSystemComponentException
|
||||
*/
|
||||
public function d3GA4getRemovedArticlesListObject() :void
|
||||
{
|
||||
$this->addTplParam('hasBeenReloaded', false);
|
||||
// collecting items to add
|
||||
$aProducts = Registry::getRequest()->getRequestEscapedParameter('aproducts');
|
||||
|
||||
// collecting specified item
|
||||
$sProductId = Registry::getRequest()->getRequestEscapedParameter('aid');
|
||||
if ($sProductId) {
|
||||
// additionally fetching current product info
|
||||
$dAmount = Registry::getRequest()->getRequestEscapedParameter('am');
|
||||
|
||||
// select lists
|
||||
$aSel = Registry::getRequest()->getRequestEscapedParameter('sel');
|
||||
|
||||
/** @var BasketComponent $oBasketComponent */
|
||||
$oBasketComponent = $this->getComponent('oxcmp_basket');
|
||||
|
||||
$aPersParam = $oBasketComponent->__call('getPersistedParameters', []);
|
||||
|
||||
$sBasketItemId = Registry::getRequest()->getRequestEscapedParameter('bindex');
|
||||
|
||||
$aProducts[$sProductId] = [
|
||||
'am' => $dAmount,
|
||||
'sel' => $aSel,
|
||||
'persparam' => $aPersParam,
|
||||
'basketitemid' => $sBasketItemId
|
||||
];
|
||||
}
|
||||
|
||||
if (is_array($aProducts) && count($aProducts)) {
|
||||
$toRemoveArticleIdList = [];
|
||||
$artIdOnArtAmountList = [];
|
||||
|
||||
if ($this->isArticleRemovedState($aProducts)) {
|
||||
//setting amount to 0 if removing article from basket
|
||||
foreach ($aProducts as $sProductId => $aProduct) {
|
||||
if ((isset($aProduct['remove']) && $aProduct['remove']) or intval($aProduct['am']) === 0) {
|
||||
if (!in_array($aProduct, $toRemoveArticleIdList)) {
|
||||
$toRemoveArticleIdList[] = $aProduct['aid'];
|
||||
$artIdOnArtAmountList[$aProduct['aid']] = $aProduct['am'];
|
||||
}
|
||||
|
||||
$aProducts[$sProductId]['am'] = 0;
|
||||
#for GA4 Event
|
||||
$this->addTplParam('hasBeenReloaded', true);
|
||||
} else {
|
||||
unset($aProducts[$sProductId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oArtList = oxNew(ArticleList::class);
|
||||
$oArtList->loadIds($toRemoveArticleIdList);
|
||||
|
||||
#dumpVar($this->getBasketArticles());
|
||||
|
||||
/** @var Article $item */
|
||||
foreach ($oArtList->getArray() as $item){
|
||||
foreach ($artIdOnArtAmountList as $artId => $artAmount){
|
||||
if ($item->getId() === $artId){
|
||||
$item->assign(['d3AmountThatGotRemoved' => $artAmount]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->addTplParam('toRemoveArticles', $oArtList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*
|
||||
* checks, if we're in the short state of "an Article has been removed"
|
||||
* We check by looking for the "'removeBtn' is not null", as a sign for it has been triggered/ clicked
|
||||
* if that doesn't work, we check if there's an Article in the Products array, that has "'am' = 0"
|
||||
* Which also shows we're in that state rn
|
||||
*/
|
||||
protected function isArticleRemovedState(array $productsArray) :bool
|
||||
{
|
||||
if (Registry::getRequest()->getRequestEscapedParameter('removeBtn')
|
||||
or Registry::getRequest()->getRequestEscapedParameter('updateBtn')
|
||||
){
|
||||
return true;
|
||||
}else{
|
||||
foreach ($productsArray as $aProduct) {
|
||||
if (intval($aProduct['am']) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Country;
|
||||
use OxidEsales\Eshop\Application\Model\Order;
|
||||
|
||||
class ThankYouController extends ThankYouController_parent
|
||||
{
|
||||
/**
|
||||
* @return Country
|
||||
*/
|
||||
public function d3GAGetUserCountry()
|
||||
{
|
||||
/** @var Order $oOrder */
|
||||
$oOrder = $this->getOrder();
|
||||
$sCountryId = $oOrder->getFieldData('oxbillcountryid');
|
||||
|
||||
/** @var Country $oCountry */
|
||||
$oCountry = oxNew(Country::class);
|
||||
$oCountry->load($sCountryId);
|
||||
|
||||
return $oCountry;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Payment;
|
||||
|
||||
class Basket extends Basket_parent
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentOnPaymentId() :string
|
||||
{
|
||||
if ($this->getPaymentId()){
|
||||
$oPayment = oxNew(Payment::class);
|
||||
if ($oPayment->load($this->getPaymentId())){
|
||||
return $oPayment->getFieldData('oxdesc');
|
||||
}
|
||||
}
|
||||
|
||||
return "couldn't load payment!";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
class Category extends Category_parent
|
||||
{
|
||||
/**
|
||||
* @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
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
class Manufacturer extends Manufacturer_parent
|
||||
{
|
||||
/**
|
||||
* @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
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -12,9 +12,16 @@
|
|||
|
||||
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\Model\User;
|
||||
use OxidEsales\Eshop\Core\Config;
|
||||
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
|
||||
{
|
||||
|
@ -27,42 +34,32 @@ class ViewConfig extends ViewConfig_parent
|
|||
{
|
||||
if ($this->sContainerId === null)
|
||||
{
|
||||
|
||||
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID');
|
||||
$this->sContainerId = ContainerFactory::getInstance()
|
||||
->getContainer()
|
||||
->get(ModuleSettingBridgeInterface::class)
|
||||
->get('d3_gtm_sContainerID', 'd3googleanalytics4');
|
||||
}
|
||||
return $this->sContainerId;
|
||||
}
|
||||
|
||||
public function getModuleConsentmanagerSettingSelectValue() :bool
|
||||
{
|
||||
return Registry::getConfig()->getConfigParam('d3_gtm_settings_HAS_CONSENTMANAGER') === 'YES';
|
||||
}
|
||||
|
||||
public function getCookieManagerType()
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function defineCookieManagerType() :void
|
||||
{
|
||||
if ($this->sCookieManagerType === null)
|
||||
{
|
||||
$this->sCookieManagerType = false;
|
||||
|
||||
$allowedManagerTypes = [
|
||||
'net_cookie_manager',
|
||||
'agcookiecompliance',
|
||||
'oxps_usercentrics'
|
||||
];
|
||||
|
||||
foreach ($allowedManagerTypes as $type) {
|
||||
if ($this->isModuleActive($type)) {
|
||||
$this->sCookieManagerType = $type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/** @var ManagerHandler $oManagerHandler */
|
||||
$oManagerHandler = oxNew(ManagerHandler::class);
|
||||
$this->sCookieManagerType = $oManagerHandler->getCurrManager();
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === false and $this->getModuleConsentmanagerSettingSelectValue()){
|
||||
return "consentmanager";
|
||||
}
|
||||
|
||||
return $this->sCookieManagerType;
|
||||
}
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function shallUseOwnCookieManager() :bool
|
||||
{
|
||||
return (bool) Registry::getConfig()->getConfigParam('d3_gtm_settings_hasOwnCookieManager');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,34 +71,43 @@ class ViewConfig extends ViewConfig_parent
|
|||
$oConfig = Registry::getConfig();
|
||||
|
||||
// No Cookie Manager in use
|
||||
if (!$oConfig->getConfigParam('d3_gtm_settings_hasOwnCookieManager')) {
|
||||
if (!$this->shallUseOwnCookieManager()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$sCookieID = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||
$this->defineCookieManagerType();
|
||||
|
||||
$sCookieID = trim($oConfig->getConfigParam('d3_gtm_settings_controlParameter'));
|
||||
|
||||
// Netensio Cookie Manager
|
||||
if ($this->getCookieManagerType() == "net_cookie_manager") {
|
||||
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
||||
$oSession = Registry::getSession();
|
||||
$aCookies = $oSession->getVariable("aCookieSel");
|
||||
|
||||
return (!is_null($aCookies) && is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1");
|
||||
return (is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1");
|
||||
}
|
||||
|
||||
// Aggrosoft Cookie Consent
|
||||
if ($this->getCookieManagerType() == "agcookiecompliance") {
|
||||
if ($this->sCookieManagerType === ManagerTypes::AGCOOKIECOMPLIANCE) {
|
||||
if (method_exists($this, "isCookieCategoryEnabled")) {
|
||||
return $this->isCookieCategoryEnabled($sCookieID);
|
||||
}
|
||||
}
|
||||
|
||||
// UserCentrics
|
||||
if ($this->getCookieManagerType() === "oxps_usercentrics" or $this->getCookieManagerType() === 'consentmanager') {
|
||||
// UserCentrics or consentmanager
|
||||
if (
|
||||
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
||||
or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
|
||||
or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST
|
||||
or $this->sCookieManagerType === ManagerTypes::COOKIEBOT
|
||||
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
|
||||
)
|
||||
{
|
||||
// Always needs the script-tags delivered to the DOM.
|
||||
return true;
|
||||
}
|
||||
|
||||
// Cookie Manager not (yet) supported
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -110,29 +116,33 @@ class ViewConfig extends ViewConfig_parent
|
|||
* This is especially important for UserCentrics.
|
||||
* @return string
|
||||
*/
|
||||
public function getGtmScriptAttributes()
|
||||
public function getGtmScriptAttributes() :string
|
||||
{
|
||||
$oConfig = Registry::getConfig();
|
||||
$sControlParameter = trim(Registry::getConfig()->getConfigParam('d3_gtm_settings_controlParameter'));
|
||||
|
||||
if ($this->getCookieManagerType() == "oxps_usercentrics") {
|
||||
$sCookieId = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||
|
||||
if ($sCookieId) {
|
||||
return 'type="text/plain" data-usercentrics="' . $sCookieId . '"';
|
||||
}
|
||||
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')){
|
||||
return "";
|
||||
}
|
||||
|
||||
if ($this->getCookieManagerType() == "consentmanager") {
|
||||
$sCookieId = $oConfig->getConfigParam('d3_gtm_settings_cookieName');
|
||||
if (
|
||||
$this->sCookieManagerType === ManagerTypes::USERCENTRICS_MODULE
|
||||
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
|
||||
)
|
||||
{
|
||||
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
|
||||
}
|
||||
|
||||
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"
|
||||
';
|
||||
}
|
||||
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
||||
{
|
||||
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEFIRST){
|
||||
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
|
||||
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
|
||||
}
|
||||
|
||||
return "";
|
||||
|
@ -140,11 +150,18 @@ class ViewConfig extends ViewConfig_parent
|
|||
|
||||
private $blGA4enabled = null;
|
||||
|
||||
/**
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function isGA4enabled()
|
||||
{
|
||||
if ($this->blGA4enabled === null)
|
||||
{
|
||||
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4');
|
||||
$this->sContainerId = ContainerFactory::getInstance()
|
||||
->getContainer()
|
||||
->get(ModuleSettingBridgeInterface::class)
|
||||
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
|
||||
}
|
||||
|
||||
return $this->blGA4enabled;
|
||||
|
@ -156,7 +173,7 @@ class ViewConfig extends ViewConfig_parent
|
|||
|
||||
$oConfig = Registry::getConfig();
|
||||
$oView = $oConfig->getTopActiveView();
|
||||
/** @var FrontendController $oShop */
|
||||
/** @var User|false|null $oUser */
|
||||
$oUser = $oConfig->getUser();
|
||||
|
||||
$cl = $this->getTopActiveClassName();
|
||||
|
@ -179,14 +196,19 @@ class ViewConfig extends ViewConfig_parent
|
|||
'title' => $oView->getTitle(),
|
||||
'cl' => $cl,
|
||||
],
|
||||
'userid' => ($oUser ? $oUser->getId() : false),
|
||||
'sessionid' => session_id() ?? false,
|
||||
'userid' => $oUser instanceof User ? $oUser->getId() : false,
|
||||
'sessionid' => session_id(),
|
||||
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
||||
];
|
||||
|
||||
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
public function isDebugModeOn() :bool
|
||||
{
|
||||
return Registry::getConfig()->getConfigParam('d3_gtm_blEnableDebug');
|
||||
}
|
||||
|
||||
public function isPromotionList($listId)
|
||||
{
|
||||
$oConfig = Registry::getConfig();
|
||||
|
|
|
@ -23,13 +23,17 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
|
|||
Ă–ffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). FĂĽhren Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
|
||||
|
||||
```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.
|
||||
|
||||
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
||||
|
||||
### 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"
|
||||
|
|
|
@ -45,8 +45,9 @@
|
|||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"oxid-esales/oxideshop-ce": "v6.0 - 6.3",
|
||||
"google/apiclient":" ^2.0"
|
||||
"oxid-esales/oxideshop-ce": "^6.5",
|
||||
"google/apiclient":" ^2.0",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
|
119
metadata.php
119
metadata.php
|
@ -1,5 +1,36 @@
|
|||
<?php
|
||||
|
||||
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\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\Model\Basket as Basket;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
|
||||
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\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\Model\Basket as OEBasket;
|
||||
use OxidEsales\Eshop\Application\Model\Category as OECategory;
|
||||
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
|
||||
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
||||
|
||||
$sMetadataVersion = '2.1';
|
||||
|
@ -17,25 +48,58 @@ $aModule = [
|
|||
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',
|
||||
'version' => '1.5.0',
|
||||
'version' => '2.15.0',
|
||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'extend' => [
|
||||
OEViewConfig::class => ViewConfig::class
|
||||
// Core
|
||||
OEViewConfig::class => ViewConfig::class,
|
||||
|
||||
// Model
|
||||
OECategory::class => Category::class,
|
||||
OEBasket::class => Basket::class,
|
||||
OEManufacturer::class => Manufacturer::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' => [
|
||||
// GA4 events
|
||||
'ga4_add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl',
|
||||
'ga4_search.tpl' => 'd3/googleanalytics4/Application/views/ga4/search.tpl',
|
||||
'ga4_view_item_list.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item_list.tpl',
|
||||
// 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/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',
|
||||
],
|
||||
'blocks' => [
|
||||
// tag manager js
|
||||
[
|
||||
'template' => 'layout/base.tpl',
|
||||
'block' => 'head_meta_robots',
|
||||
'file' => '/Application/views/blocks/_gtm_js.tpl'
|
||||
'file' => '/Application/views/blocks/_gtm_js.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// tag manager nojs
|
||||
[
|
||||
|
@ -54,33 +118,52 @@ $aModule = [
|
|||
[
|
||||
'template' => 'page/checkout/basket.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => '/Application/views/blocks/checkout_s1.tpl'
|
||||
'file' => '/Application/views/blocks/view_cart.tpl'
|
||||
],
|
||||
[
|
||||
'template' => 'page/checkout/thankyou.tpl',
|
||||
'block' => 'checkout_thankyou_main',
|
||||
'file' => '/Application/views/blocks/checkout_s5.tpl'
|
||||
'file' => '/Application/views/blocks/purchase.tpl'
|
||||
],
|
||||
// Lists
|
||||
// view_item_list
|
||||
[
|
||||
'template' => 'widget/product/list.tpl',
|
||||
'block' => 'widget_product_list',
|
||||
'file' => '/Application/views/ga4/view_item_list.tpl',
|
||||
'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/ga4/search.tpl',
|
||||
'file' => '/Application/views/blocks/view_search_result.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// add_to_cart
|
||||
[
|
||||
'template' => 'page/details/inc/productmain.tpl',
|
||||
'block' => 'details_productmain_tobasket',
|
||||
'file' => '/Application/views/ga4/add_to_cart.tpl',
|
||||
'file' => '/Application/views/blocks/details_productmain_tobasket.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
|
||||
],
|
||||
// remove_from_cart
|
||||
[
|
||||
'template' => 'page/checkout/basket.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||
'position' => 150
|
||||
]
|
||||
],
|
||||
|
@ -115,17 +198,17 @@ $aModule = [
|
|||
],
|
||||
[
|
||||
'group' => 'd3_gtm_settings_cookiemanager',
|
||||
'name' => 'd3_gtm_settings_cookieName',
|
||||
'name' => 'd3_gtm_settings_controlParameter',
|
||||
'type' => 'str',
|
||||
'value' => 'example',
|
||||
'value' => '',
|
||||
'position' => 999
|
||||
],
|
||||
[
|
||||
'group' => 'd3_gtm_settings_cookiemanager',
|
||||
'name' => 'd3_gtm_settings_HAS_CONSENTMANAGER',
|
||||
'name' => 'd3_gtm_settings_HAS_STD_MANAGER',
|
||||
'type' => 'select',
|
||||
'value' => 'none',
|
||||
'constraints' => 'NO|YES',
|
||||
'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS|COOKIEFIRST|COOKIEBOT',
|
||||
],
|
||||
]
|
||||
];
|
13
phpstan.neon
13
phpstan.neon
|
@ -1,10 +1,15 @@
|
|||
parameters:
|
||||
scanFiles:
|
||||
- IntelliSenseHelper.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/bootstrap.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
||||
level: 9
|
||||
phpVersion: 70100
|
||||
checkMissingIterableValueType: false
|
||||
scanDirectories:
|
||||
- ../../oxid-esales
|
||||
ignoreErrors:
|
||||
- '#Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
|
||||
- '#.*is not subtype of Throwable.*#'
|
||||
paths:
|
||||
- ./
|
||||
level: 5
|
||||
phpVersion: 80100
|
||||
checkMissingIterableValueType: false
|
||||
|
|
Loading…
Reference in New Issue