Compare commits
No commits in common. "2.20.0" and "2.19.0" have entirely different histories.
@ -1,3 +0,0 @@
|
|||||||
[{$smarty.block.parent}]
|
|
||||||
|
|
||||||
[{include file="event/add_payment_info.tpl"}]
|
|
@ -1,3 +0,0 @@
|
|||||||
[{$smarty.block.parent}]
|
|
||||||
|
|
||||||
[{include file="event/begin_checkout.tpl"}]
|
|
@ -1,53 +0,0 @@
|
|||||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
|
||||||
|
|
||||||
[{assign var="gtmBasketPrice" value=$oxcmp_basket->getPrice()}]
|
|
||||||
[{assign var="gtmBasketObject" value=$oxcmp_basket}]
|
|
||||||
[{assign var='gtmCartArticles' value=$gtmBasketObject->getBasketArticles()}]
|
|
||||||
[{assign var="gtmPaymentObject" value=$oView->getPayment()}]
|
|
||||||
|
|
||||||
[{block name="gtm_ga4_add_payment_info_block"}]
|
|
||||||
[{capture name="gtm_ga4_add_payment_info"}]
|
|
||||||
[{strip}]
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'add_payment_info',
|
|
||||||
'eventLabel':'Checkout - Payment info',
|
|
||||||
'payment_type':'[{$gtmPaymentObject->gtmGetSelectedPaymentName()}]',
|
|
||||||
'ecommerce':
|
|
||||||
{
|
|
||||||
'actionField': "Payment-Info",
|
|
||||||
'currency': "[{$currency->name}]",
|
|
||||||
'value': [{$gtmBasketPrice->getPrice()}],
|
|
||||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
|
||||||
'items':
|
|
||||||
[
|
|
||||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
|
||||||
[{assign var="gtmItemPriceObject" value=$basketitem->getPrice()}]
|
|
||||||
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
|
||||||
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
|
||||||
{
|
|
||||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
|
||||||
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
|
||||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
|
||||||
[{if $gtmBasketItemCategory}]
|
|
||||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
|
||||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
|
||||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
|
||||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
|
||||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
|
||||||
[{/if}]
|
|
||||||
'price': [{$gtmItemPriceObject->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.gtm_ga4_add_payment_info}]
|
|
||||||
[{/block}]
|
|
@ -1,51 +0,0 @@
|
|||||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
|
||||||
|
|
||||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
|
||||||
[{assign var="d3BasketObject" value=$oxcmp_basket}]
|
|
||||||
[{assign var='gtmCartArticles' value=$d3BasketObject->getBasketArticles()}]
|
|
||||||
|
|
||||||
[{block name="d3_ga4_begin_checkout_block"}]
|
|
||||||
[{capture name="d3_ga4_begin_checkout"}]
|
|
||||||
[{strip}]
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'begin_checkout',
|
|
||||||
'eventLabel':'Begin of checkout',
|
|
||||||
'ecommerce':
|
|
||||||
{
|
|
||||||
'actionField': "Begin",
|
|
||||||
'currency': "[{$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_begin_checkout}]
|
|
||||||
[{/block}]
|
|
@ -6,11 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x
|
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x
|
||||||
|
|
||||||
## [2.20.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.19.0...2.20.0) - 2024-08-20
|
|
||||||
### Added
|
|
||||||
- new event "begin_checkout"
|
|
||||||
- new event "add_payment_info"
|
|
||||||
|
|
||||||
## [2.19.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.2...2.19.0) - 2024-08-10
|
## [2.19.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.2...2.19.0) - 2024-08-10
|
||||||
### Fixed
|
### Fixed
|
||||||
- usage of not yet existing function
|
- usage of not yet existing function
|
||||||
|
@ -18,14 +18,9 @@ namespace D3\GoogleAnalytics4\Modules\Core{
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\Payment;
|
|
||||||
|
|
||||||
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
|
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
|
||||||
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
|
||||||
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {}
|
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {}
|
||||||
|
|
||||||
class gtmPayment_parent extends Payment {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
|
||||||
|
|
||||||
|
|
||||||
use OxidEsales\Eshop\Application\Model\Payment;
|
|
||||||
use OxidEsales\Eshop\Core\Registry;
|
|
||||||
|
|
||||||
class gtmPayment extends gtmPayment_parent
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function gtmGetSelectedPaymentName() :string
|
|
||||||
{
|
|
||||||
return $this->getFieldData('oxpayments__oxdesc')?: 'No payment name available';
|
|
||||||
}
|
|
||||||
}
|
|
52
metadata.php
52
metadata.php
@ -16,7 +16,6 @@ use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController;
|
|||||||
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
|
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
|
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
|
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\gtmPayment as gtmPayment;
|
|
||||||
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
|
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
|
||||||
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
||||||
use OxidEsales\Eshop\Application\Component\BasketComponent as OEBasketComponent;
|
use OxidEsales\Eshop\Application\Component\BasketComponent as OEBasketComponent;
|
||||||
@ -34,7 +33,6 @@ use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouCont
|
|||||||
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
|
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
|
||||||
use OxidEsales\Eshop\Application\Model\Category as OECategory;
|
use OxidEsales\Eshop\Application\Model\Category as OECategory;
|
||||||
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
|
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
|
||||||
use OxidEsales\Eshop\Application\Model\Payment as OEPayment;
|
|
||||||
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
||||||
|
|
||||||
$sMetadataVersion = '2.1';
|
$sMetadataVersion = '2.1';
|
||||||
@ -52,7 +50,7 @@ $aModule = [
|
|||||||
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
||||||
",
|
",
|
||||||
'thumbnail' => 'thumbnail.png',
|
'thumbnail' => 'thumbnail.png',
|
||||||
'version' => '2.20.0',
|
'version' => '2.19.0',
|
||||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||||
'email' => 'support@shopmodule.com',
|
'email' => 'support@shopmodule.com',
|
||||||
'url' => 'https://www.oxidmodule.com/',
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
@ -67,7 +65,6 @@ $aModule = [
|
|||||||
OECategory::class => Category::class,
|
OECategory::class => Category::class,
|
||||||
OEBasket::class => Basket::class,
|
OEBasket::class => Basket::class,
|
||||||
OEManufacturer::class => Manufacturer::class,
|
OEManufacturer::class => Manufacturer::class,
|
||||||
OEPayment::class => gtmPayment::class,
|
|
||||||
|
|
||||||
// Controller
|
// Controller
|
||||||
OEBasketController::class => BasketController::class,
|
OEBasketController::class => BasketController::class,
|
||||||
@ -89,9 +86,7 @@ $aModule = [
|
|||||||
// Event files that store the GA4 Event-Information
|
// Event files that store the GA4 Event-Information
|
||||||
'event/add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/event/add_to_cart.tpl',
|
'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_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
|
||||||
'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
|
'event/view_cart.tpl' => 'd3/googleanalytics4/Application/views/event/view_cart.tpl',
|
||||||
'event/begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/event/begin_checkout.tpl',
|
|
||||||
'event/add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/event/add_payment_info.tpl',
|
|
||||||
'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl',
|
'event/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_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/view_search_result.tpl' => 'd3/googleanalytics4/Application/views/event/view_search_result.tpl',
|
||||||
@ -128,26 +123,12 @@ $aModule = [
|
|||||||
'file' => '/Application/views/blocks/view_item.tpl',
|
'file' => '/Application/views/blocks/view_item.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
// View Cart
|
// checkout
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/basket.tpl',
|
'template' => 'page/checkout/basket.tpl',
|
||||||
'block' => 'checkout_basket_main',
|
'block' => 'checkout_basket_main',
|
||||||
'file' => '/Application/views/blocks/view_cart.tpl'
|
'file' => '/Application/views/blocks/view_cart.tpl'
|
||||||
],
|
],
|
||||||
// add_to_cart
|
|
||||||
[
|
|
||||||
'template' => 'page/details/inc/productmain.tpl',
|
|
||||||
'block' => 'details_productmain_tobasket',
|
|
||||||
'file' => '/Application/views/blocks/details_productmain_tobasket.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
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/thankyou.tpl',
|
'template' => 'page/checkout/thankyou.tpl',
|
||||||
'block' => 'checkout_thankyou_main',
|
'block' => 'checkout_thankyou_main',
|
||||||
@ -168,6 +149,13 @@ $aModule = [
|
|||||||
'file' => '/Application/views/blocks/view_search_result.tpl',
|
'file' => '/Application/views/blocks/view_search_result.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
|
// add_to_cart
|
||||||
|
[
|
||||||
|
'template' => 'page/details/inc/productmain.tpl',
|
||||||
|
'block' => 'details_productmain_tobasket',
|
||||||
|
'file' => '/Application/views/blocks/details_productmain_tobasket.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'template' => 'page/list/list.tpl',
|
'template' => 'page/list/list.tpl',
|
||||||
'block' => 'page_list_listbody',
|
'block' => 'page_list_listbody',
|
||||||
@ -180,23 +168,13 @@ $aModule = [
|
|||||||
'file' => '/Application/views/blocks/start_welcome_text.tpl',
|
'file' => '/Application/views/blocks/start_welcome_text.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
],
|
||||||
// Checkout process
|
// remove_from_cart
|
||||||
// Begin CHeckout
|
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/user.tpl',
|
'template' => 'page/checkout/basket.tpl',
|
||||||
'block' => 'checkout_user_main',
|
'block' => 'checkout_basket_main',
|
||||||
'file' => '/Application/views/blocks/begin_checkout.tpl',
|
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||||
'position' => 150
|
'position' => 150
|
||||||
],
|
]
|
||||||
// Add payment info
|
|
||||||
// We add it into checkout_order_main ( checkout/order.tpl ) to make sure a payment is actually added;
|
|
||||||
// we'll also do it like that in the future for add_shipping_info ( not planed yet )
|
|
||||||
[
|
|
||||||
'template' => 'page/checkout/order.tpl',
|
|
||||||
'block' => 'checkout_order_main',
|
|
||||||
'file' => '/Application/views/blocks/add_payment_info.tpl',
|
|
||||||
'position' => 150
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
'events' => [
|
'events' => [
|
||||||
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
|
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user