Commits vergleichen
65 Commits
Autor | SHA1 | Datum | |
---|---|---|---|
59ef1d0625 | |||
e4969f2cbd | |||
13ef2bef7b | |||
59f0e37cce | |||
bcf38a6e11 | |||
31b3474cfd | |||
1a641de8fc | |||
268cf6f6da | |||
5d5b3459cd | |||
1c1080923b | |||
007e83909b | |||
229cf3695f | |||
a990834da4 | |||
6047f72edf | |||
e2564f613a | |||
9ea5408e44 | |||
ab6b7f7454 | |||
a88fa570a8 | |||
81aab10c4e | |||
5ac3385b53 | |||
5c98d99d80 | |||
da2966626e | |||
6fcee0671f | |||
f64eb35763 | |||
b2d8d597fd | |||
36ac641233 | |||
99af4cdfa9 | |||
eb2c7f73b9 | |||
575e35ffbc | |||
2e6acbe675 | |||
aae6c43786 | |||
17840d33b1 | |||
a49c29d7aa | |||
e90aba2c55 | |||
ea6b63fd2f | |||
6b18c50b42 | |||
443b456a0d | |||
216c53fa90 | |||
5355b0a7ad | |||
432ba54c84 | |||
8b344ffb85 | |||
0009926313 | |||
50be757355 | |||
60f61f4bab | |||
a93b1cf582 | |||
3f59d1f210 | |||
5ed924e840 | |||
d4ef0f35f9 | |||
c17ae1cef5 | |||
32e08a88ca | |||
9d9daf9a85 | |||
6eefc062ba | |||
3f89e26bde | |||
e624cfdfcb | |||
e2cdda530b | |||
3e65d05c0b | |||
561a2101f1 | |||
6fca52cc06 | |||
dfdc5d5edf | |||
ae6f9bfaa9 | |||
1d9e09b8b1 | |||
f9a0834d26 | |||
bb70cda626 | |||
c9a1174c98 | |||
|
f3b2911679 |
1
.gitignore
vendored
Normale Datei
1
.gitignore
vendored
Normale Datei
@ -0,0 +1 @@
|
||||
.idea
|
@ -31,11 +31,11 @@ $aLang = [
|
||||
// for cookie manager settings
|
||||
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
||||
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Cookie Manager nutzen?',
|
||||
'HELP_SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Mehr Informationen zu den genannten Coookie-Manager finden Sie auf den folgenden Home-Pages<br>
|
||||
'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.',
|
||||
|
3
Application/views/blocks/details_productmain_tobasket.tpl
Normale Datei
3
Application/views/blocks/details_productmain_tobasket.tpl
Normale Datei
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
3
Application/views/blocks/page_list_listbody.tpl
Normale Datei
3
Application/views/blocks/page_list_listbody.tpl
Normale Datei
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,56 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{block name="d3_ga4_purchase_block"}]
|
||||
[{capture assign=d3_ga4_purchase}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
[{assign var="gtmOrder" value=$oView->getOrder()}]
|
||||
[{assign var="gtmBasket" value=$oView->getBasket()}]
|
||||
[{assign var="gtmArticles" value=$gtmOrder->getOrderArticles()}]
|
||||
[{assign var="gtmOrderVouchers" value=$gtmOrder->getVoucherNrList()}]
|
||||
|
||||
dataLayer.push({
|
||||
'event': 'purchase',
|
||||
'eventLabel':'Checkout Step 5',
|
||||
'ecommerce': {
|
||||
'transaction_id': '[{$gtmOrder->getFieldData("oxordernr")}]',
|
||||
'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]',
|
||||
'value': [{$gtmOrder->getTotalOrderSum()}],
|
||||
'tax': [{math equation="x+y" x=$gtmOrder->getFieldData("oxartvatprice1") y=$gtmOrder->getFieldData("oxartvatprice2") }],
|
||||
'shipping': [{$gtmOrder->getFieldData("oxdelcost")}],
|
||||
'currency': '[{$gtmOrder->getFieldData('oxcurrency')}]',
|
||||
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
||||
'paymentType': '[{$gtmBasket->getPaymentOnPaymentId()}]',
|
||||
'items': [
|
||||
[{foreach from=$gtmArticles item="gtmBasketItem" name="gtmArticles"}]
|
||||
[{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}]
|
||||
[{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}]
|
||||
[{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}]
|
||||
|
||||
{
|
||||
'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
||||
'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
||||
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
||||
'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]',
|
||||
[{if $gtmPurchaseItemCategory}]
|
||||
'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$gtmPurchaseItemPriceObject->getPrice()}],
|
||||
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
|
||||
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
||||
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
})
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_purchase}]
|
||||
[{/block}]
|
||||
[{include file="event/purchase.tpl"}]
|
||||
|
3
Application/views/blocks/remove_from_cart.tpl
Normale Datei
3
Application/views/blocks/remove_from_cart.tpl
Normale Datei
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/remove_from_cart.tpl"}]
|
3
Application/views/blocks/start_welcome_text.tpl
Normale Datei
3
Application/views/blocks/start_welcome_text.tpl
Normale Datei
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,50 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{*$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 assign=d3_ga4_view_cart}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'event': 'view_cart',
|
||||
'eventLabel':'Checkout Step 1',
|
||||
'ecommerce': {
|
||||
'actionField': "step: 1",
|
||||
'currency': "[{$currency->name}]",
|
||||
'value': [{$d3BasketPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'items': [
|
||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
||||
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||
{
|
||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||
[{if $gtmBasketItemCategory}]
|
||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$d3oItemPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'quantity': [{$basketitem->getAmount()}],
|
||||
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_cart}]
|
||||
[{/block}]
|
||||
[{include file="event/view_cart.tpl"}]
|
||||
|
@ -1,40 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
|
||||
[{block name="d3_ga4_view_item_block"}]
|
||||
[{capture assign=d3_ga4_view_item}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
|
||||
dataLayer.push({
|
||||
'event': 'view_item',
|
||||
'eventLabel':'Product View',
|
||||
'ecommerce': {
|
||||
'currency': '[{$currency->name}]',
|
||||
'items': [
|
||||
{
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
|
||||
[{if $gtmCategory}]
|
||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
'price': [{$d3PriceObject->getPrice()}]
|
||||
}
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_item}]
|
||||
[{/block}]
|
||||
[{include file="event/view_item.tpl"}]
|
||||
|
3
Application/views/blocks/view_item_list.tpl
Normale Datei
3
Application/views/blocks/view_item_list.tpl
Normale Datei
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_item_list.tpl"}]
|
3
Application/views/blocks/view_search_result.tpl
Normale Datei
3
Application/views/blocks/view_search_result.tpl
Normale Datei
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_search_result.tpl"}]
|
61
Application/views/event/add_to_cart.tpl
Normale Datei
61
Application/views/event/add_to_cart.tpl
Normale Datei
@ -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}]
|
56
Application/views/event/purchase.tpl
Normale Datei
56
Application/views/event/purchase.tpl
Normale Datei
@ -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}]
|
46
Application/views/event/remove_from_cart.tpl
Normale Datei
46
Application/views/event/remove_from_cart.tpl
Normale Datei
@ -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}]
|
50
Application/views/event/view_cart.tpl
Normale Datei
50
Application/views/event/view_cart.tpl
Normale Datei
@ -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}]
|
41
Application/views/event/view_item.tpl
Normale Datei
41
Application/views/event/view_item.tpl
Normale Datei
@ -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}]
|
@ -1,4 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
|
||||
|
||||
@ -6,7 +5,7 @@
|
||||
|
||||
[{block name="d3_ga4_view_item_list_block"}]
|
||||
[{if $gtmProducts|@count}]
|
||||
[{capture assign=d3_ga4_view_item_list}]
|
||||
[{capture name="d3_ga4_view_item_list"}]
|
||||
[{strip}]
|
||||
dataLayer.push({ecommerce: null});
|
||||
dataLayer.push({
|
||||
@ -26,10 +25,10 @@
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{if $gtmCategory}]
|
||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
||||
'item_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}]
|
||||
@ -41,6 +40,6 @@
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_item_list}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_item_list}]
|
||||
[{/if}]
|
||||
[{/block}]
|
44
Application/views/event/view_search_result.tpl
Normale Datei
44
Application/views/event/view_search_result.tpl
Normale Datei
@ -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,52 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{* variable $gtmProduct is passed from parent tempalte *}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||
|
||||
[{block name="d3_ga4_add_to_cart_block"}]
|
||||
[{capture assign=d3_ga4_add_to_cart}]
|
||||
[{strip}]
|
||||
$("#toBasket").click(function(event) {
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
|
||||
[{*** Debug cases ***}]
|
||||
[{*event.preventDefault();*}]
|
||||
|
||||
let iArtQuantity = $("#amountToBasket").val();
|
||||
|
||||
dataLayer.push({
|
||||
'isAddToBasket': true,
|
||||
'event':'add_to_cart',
|
||||
'eventLabel': 'add_to_cart',
|
||||
'ecommerce': {
|
||||
'currency': "[{$currency->name}]",
|
||||
'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
|
||||
'items': [
|
||||
{
|
||||
'item_id': '[{$gtmProduct->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData('oxtitle')}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
'item_variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]',
|
||||
[{if $gtmCategory}]
|
||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'quantity': iArtQuantity
|
||||
}
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_add_to_cart}]
|
||||
[{/block}]
|
18
Application/views/tpl/page/account/d3gtmnoticelist.tpl
Normale Datei
18
Application/views/tpl/page/account/d3gtmnoticelist.tpl
Normale Datei
@ -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"}]
|
32
Application/views/tpl/page/account/d3gtmrecommendationlist.tpl
Normale Datei
32
Application/views/tpl/page/account/d3gtmrecommendationlist.tpl
Normale Datei
@ -0,0 +1,32 @@
|
||||
[{capture append="oxidBlock_content"}]
|
||||
[{assign var="template_title" value="LISTMANIA"|oxmultilangassign}]
|
||||
[{assign var="_actvrecommlist" value=$oView->getActiveRecommList()}]
|
||||
|
||||
<h1 class="page-header">[{oxmultilang ident="LISTMANIA"}]</h1>
|
||||
|
||||
[{if $oView->isSavedList()}]
|
||||
[{assign var="_statusMessage" value="LISTMANIA_LIST_SAVED"|oxmultilangassign}]
|
||||
[{include file="message/success.tpl" statusMessage=$_statusMessage}]
|
||||
[{/if}]
|
||||
|
||||
[{block name="account_redommendationlist_content"}]
|
||||
|
||||
[{include file="form/recommendation_edit.tpl" actvrecommlist=$_actvrecommlist}]
|
||||
|
||||
<hr>
|
||||
|
||||
[{if !$oView->getActiveRecommList()}]
|
||||
[{assign var="blEdit" value=true}]
|
||||
[{include file="page/recommendations/inc/list.tpl"}]
|
||||
[{/if}]
|
||||
[{/block}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
||||
|
||||
[{insert name="oxid_tracker" title=$template_title}]
|
||||
[{/capture}]
|
||||
[{capture append="oxidBlock_sidebar"}]
|
||||
[{include file="page/account/inc/account_menu.tpl" active_link="recommendationlist"}]
|
||||
[{/capture}]
|
||||
[{include file="layout/page.tpl" sidebar="Left"}]
|
||||
|
44
Application/views/tpl/page/account/d3gtmwishlist.tpl
Normale Datei
44
Application/views/tpl/page/account/d3gtmwishlist.tpl
Normale Datei
@ -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"}]
|
42
CHANGELOG.md
42
CHANGELOG.md
@ -4,8 +4,16 @@ 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.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
|
||||
### 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
|
||||
@ -129,6 +137,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20
|
||||
### Added
|
||||
- using of ContainerFactory in ViewConfig
|
||||
## [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
|
||||
|
@ -1,6 +1,6 @@
|
||||
# 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/
|
||||
@ -10,34 +10,7 @@ Tragen Sie hier im Normalfall die ID des zu prüfenden Cookies ein.
|
||||
In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt
|
||||
nach der gewählten CMP (Consent Manager Platform).
|
||||
|
||||
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
|
||||
|
||||
## Blöcke
|
||||
Für den geregelten Ablauf sind folgende Blöcke nötig:
|
||||
- Suchergebnisse
|
||||
- Blockname: search_results
|
||||
- Datei: page/search/search.tpl
|
||||
- GA4 Event: view_search_results
|
||||
- Artikelliste
|
||||
- Blockname: page_list_productlist (muss hinzugefügt werden)
|
||||
- Datei: page/list/list.tpl
|
||||
- GA4 Event: view_item_list
|
||||
- Detailseite
|
||||
- Blockname: details_productmain_title
|
||||
- Datei: page/details/inc/productmain.tpl
|
||||
- GA4 Event: view_item
|
||||
- dem WK hinzufügen (button)
|
||||
- Blockname: details_productmain_tobasket
|
||||
- Datei: page/details/inc/productmain.tpl
|
||||
- GA4 Event: add_to_cart
|
||||
- Warenkorb
|
||||
- Blockname: checkout_basket_main
|
||||
- Datei: page/checkout/basket.tpl
|
||||
- GA4 Event: view_cart
|
||||
- abgeschlossener Kauf
|
||||
- Blockname: checkout_thankyou_main
|
||||
- Datei: page/checkout/thankyou.tpl
|
||||
- GA4 Event: purchase
|
||||
> 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.
|
||||
@ -76,7 +49,7 @@ Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
||||
- In der Usercentrics-Verwaltung die Services "Google Analytics" und "Google Tag Manager" anlegen
|
||||
- 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
|
||||
@ -84,6 +57,9 @@ Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
||||
- 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
|
||||
|
||||
- [Cookiebot](https://www.cookiebot.com)
|
||||
- Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite.
|
||||
|
||||
- [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
|
@ -20,8 +20,39 @@ namespace D3\GoogleAnalytics4\Modules\Core{
|
||||
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\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 {}
|
||||
}
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Component{
|
||||
|
||||
use OxidEsales\Eshop\Application\Component\BasketComponent;
|
||||
|
||||
class d3GtmBasketComponentExtension_parent extends BasketComponent {}
|
||||
}
|
77
Modules/Application/Component/d3GtmBasketComponentExtension.php
Normale Datei
77
Modules/Application/Component/d3GtmBasketComponentExtension.php
Normale Datei
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Component;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Article;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
|
||||
{
|
||||
/**
|
||||
* @param $sProductId
|
||||
* @param $dAmount
|
||||
* @param $aSel
|
||||
* @param $aPersParam
|
||||
* @param $blOverride
|
||||
* @return mixed|string
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function toBasket($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false)
|
||||
{
|
||||
$return = parent::toBasket($sProductId, $dAmount, $aSel, $aPersParam, $blOverride);
|
||||
|
||||
Registry::getSession()->setVariable('d3GtmAddToBasketTrigger', true);
|
||||
|
||||
$iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am');
|
||||
|
||||
if ($iAmountArticlesAddedToCart){
|
||||
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart);
|
||||
}else{
|
||||
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getD3GtmAddToCartAmountArticles() :int
|
||||
{
|
||||
$iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles');
|
||||
|
||||
Registry::getSession()->deleteVariable('d3GtmAddToCartAmountArticles');
|
||||
|
||||
return (int) $iAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function getAddToBasketDecision() :bool
|
||||
{
|
||||
$decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger');
|
||||
|
||||
Registry::getSession()->setVariable('d3GtmAddToBasketTrigger', false);
|
||||
|
||||
return (bool) $decision;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Article|null
|
||||
*/
|
||||
public function d3GtmRequestedArticleLoadedByAnid()
|
||||
{
|
||||
$sAnid = Registry::getRequest()->getRequestEscapedParameter('anid');
|
||||
|
||||
$oArticle = null;
|
||||
|
||||
if ($sAnid){
|
||||
/** @var Article $oArticle */
|
||||
$oArticle = oxNew(Article::class);
|
||||
$oArticle->load($sAnid);
|
||||
}
|
||||
|
||||
return $oArticle;
|
||||
}
|
||||
}
|
15
Modules/Application/Controller/ArticleDetailsController.php
Normale Datei
15
Modules/Application/Controller/ArticleDetailsController.php
Normale Datei
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
class ArticleDetailsController extends ArticleDetailsController_parent
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$return = parent::render();
|
||||
|
||||
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
class ArticleListController_AddToCartHelpMethods extends ArticleListController_AddToCartHelpMethods_parent
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$render = parent::render();
|
||||
|
||||
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||
|
||||
return $render;
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ use oxSystemComponentException;
|
||||
class BasketController extends BasketController_parent
|
||||
{
|
||||
/**
|
||||
* @throws oxSystemComponentException
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
@ -33,22 +33,18 @@ class BasketController extends BasketController_parent
|
||||
$aProducts = Registry::getRequest()->getRequestEscapedParameter('aproducts');
|
||||
|
||||
// collecting specified item
|
||||
$sProductId = $sProductId ?? Registry::getRequest()->getRequestEscapedParameter('aid');
|
||||
$sProductId = Registry::getRequest()->getRequestEscapedParameter('aid');
|
||||
if ($sProductId) {
|
||||
// additionally fetching current product info
|
||||
$dAmount = $dAmount ?? Registry::getRequest()->getRequestEscapedParameter('am');
|
||||
$dAmount = Registry::getRequest()->getRequestEscapedParameter('am');
|
||||
|
||||
// select lists
|
||||
$aSel = $aSel ?? Registry::getRequest()->getRequestEscapedParameter('sel');
|
||||
$aSel = Registry::getRequest()->getRequestEscapedParameter('sel');
|
||||
|
||||
// persistent parameters
|
||||
if (empty($aPersParam)) {
|
||||
/** @var BasketComponent $oBasketComponent */
|
||||
$oBasketComponent = $this->getComponent('oxcmp_basket');
|
||||
|
||||
/** @var BasketComponent $oBasketComponent */
|
||||
$oBasketComponent = $this->getComponent('oxcmp_basket');
|
||||
|
||||
$aPersParam = $oBasketComponent->__call('getPersistedParameters', []);
|
||||
}
|
||||
$aPersParam = $oBasketComponent->__call('getPersistedParameters', []);
|
||||
|
||||
$sBasketItemId = Registry::getRequest()->getRequestEscapedParameter('bindex');
|
||||
|
||||
@ -124,4 +120,4 @@ class BasketController extends BasketController_parent
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
25
Modules/Application/Controller/ThankYouController.php
Normale Datei
25
Modules/Application/Controller/ThankYouController.php
Normale Datei
@ -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;
|
||||
}
|
||||
}
|
17
Modules/Application/Controller/d3GtmAccountNoticeListController.php
Normale Datei
17
Modules/Application/Controller/d3GtmAccountNoticeListController.php
Normale Datei
@ -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;
|
||||
}
|
||||
}
|
17
Modules/Application/Controller/d3GtmAccountRecommlistController.php
Normale Datei
17
Modules/Application/Controller/d3GtmAccountRecommlistController.php
Normale Datei
@ -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;
|
||||
}
|
||||
}
|
17
Modules/Application/Controller/d3GtmAccountWishlistController.php
Normale Datei
17
Modules/Application/Controller/d3GtmAccountWishlistController.php
Normale Datei
@ -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;
|
||||
}
|
||||
}
|
23
Modules/Application/Controller/d3GtmSearchController.php
Normale Datei
23
Modules/Application/Controller/d3GtmSearchController.php
Normale Datei
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
|
||||
class d3GtmSearchController extends d3GtmSearchController_parent
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$return = parent::render();
|
||||
|
||||
if (false === in_array('oxcmp_basket', $this->getComponents())){
|
||||
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
19
Modules/Application/Controller/d3GtmStartController.php
Normale Datei
19
Modules/Application/Controller/d3GtmStartController.php
Normale Datei
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
class d3GtmStartController extends d3GtmStartController_parent
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$return = parent::render();
|
||||
|
||||
if (false === in_array('oxcmp_basket', $this->getComponents())){
|
||||
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ use OxidEsales\Eshop\Application\Model\Payment;
|
||||
class Basket extends Basket_parent
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentOnPaymentId() :string
|
||||
{
|
||||
|
@ -8,9 +8,9 @@ class Category extends Category_parent
|
||||
* @param int $indexOfArray
|
||||
* @return string
|
||||
*/
|
||||
public function getSplitCategoryArray(int $indexOfArray = -1) :string
|
||||
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
|
||||
{
|
||||
if ($indexOfArray > -1){
|
||||
if ($bShallTakeStd){
|
||||
$splitCatArray =
|
||||
array_values(
|
||||
array_filter(
|
||||
@ -26,7 +26,7 @@ class Category extends Category_parent
|
||||
)
|
||||
);
|
||||
|
||||
if ($splitCatArray[$indexOfArray]){
|
||||
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){
|
||||
return $splitCatArray[$indexOfArray];
|
||||
}else{
|
||||
return "";
|
||||
|
@ -8,9 +8,9 @@ class Manufacturer extends Manufacturer_parent
|
||||
* @param int $indexOfArray
|
||||
* @return string
|
||||
*/
|
||||
public function getSplitCategoryArray(int $indexOfArray = -1) :string
|
||||
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
|
||||
{
|
||||
if ($indexOfArray > -1){
|
||||
if ($bShallTakeStd){
|
||||
$splitCatArray =
|
||||
array_values(
|
||||
array_filter(
|
||||
@ -26,7 +26,7 @@ class Manufacturer extends Manufacturer_parent
|
||||
)
|
||||
);
|
||||
|
||||
if ($splitCatArray[$indexOfArray]){
|
||||
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){
|
||||
return $splitCatArray[$indexOfArray];
|
||||
}else{
|
||||
return "";
|
||||
|
@ -16,7 +16,7 @@ use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
||||
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||
use OxidEsales\Eshop\Core\Config;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Application\Model\User;use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
@ -174,7 +174,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();
|
||||
@ -197,8 +197,8 @@ 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"
|
||||
];
|
||||
|
||||
|
@ -46,8 +46,8 @@
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"oxid-esales/oxideshop-ce": "^6.5",
|
||||
"google/apiclient":" ^2.0"
|
||||
},
|
||||
"google/apiclient":" ^2.0",
|
||||
"phpstan/phpstan": "^1.10" },
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||
|
76
metadata.php
76
metadata.php
@ -1,11 +1,29 @@
|
||||
<?php
|
||||
|
||||
use D3\GoogleAnalytics4\Modules\Application\Component\d3GtmBasketComponentExtension;
|
||||
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\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\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\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;
|
||||
@ -26,18 +44,42 @@ $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' => '2.13.1',
|
||||
'version' => '2.14.0',
|
||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'extend' => [
|
||||
OEViewConfig::class => ViewConfig::class,
|
||||
OECategory::class => Category::class,
|
||||
OEManufacturer::class => Manufacturer::class,
|
||||
OEBasket::class => Basket::class,
|
||||
OEBasketController::class => BasketController::class
|
||||
OEViewConfig::class => ViewConfig::class,
|
||||
OECategory::class => Category::class,
|
||||
OEBasket::class => Basket::class,
|
||||
OEBasketController::class => BasketController::class,
|
||||
OEManufacturer::class => Manufacturer::class,
|
||||
OEThankYouController::class => ThankYouController::class,
|
||||
OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class,
|
||||
OEBasketComponent::class => d3GtmBasketComponentExtension::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
|
||||
],
|
||||
'templates' => [
|
||||
// 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',
|
||||
],
|
||||
'templates' => [],
|
||||
'blocks' => [
|
||||
// tag manager js
|
||||
[
|
||||
@ -75,28 +117,40 @@ $aModule = [
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_productlist',
|
||||
'file' => '/Application/views/ga4/view_item_list.tpl',
|
||||
'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/view_search_result.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/ga4/remove_from_cart.tpl',
|
||||
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||
'position' => 150
|
||||
]
|
||||
],
|
||||
|
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
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren