Compare commits

...

3 Commits
2.3.2 ... 2.3.3

4 changed files with 39 additions and 15 deletions

View File

@ -0,0 +1,25 @@
[{$smarty.block.parent}]
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
'ecommerce': {
'currency': '[{$currency->name}]',
'items': [
{
'item_name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
'price': [{$gtmProduct->oxarticles__oxprice->value}]
}
]
}
});
</script>

View File

@ -5,6 +5,8 @@
[{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();
@ -28,7 +30,6 @@
'item_category_3':itemCategories[2] || '',
'item_category_4':itemCategories[3] || '',
[{if false}]
[{* ??? what *}]
'item_list_name': 'Search Results', // If associated with a list selection.
'item_list_id': 'SR123', // If associated with a list selection.
'index': 1, // If associated with a list selection.

View File

@ -4,6 +4,10 @@ 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.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

View File

@ -17,7 +17,7 @@ $aModule = [
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
",
'thumbnail' => 'thumbnail.png',
'version' => '2.3.2',
'version' => '2.3.3',
'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
@ -43,19 +43,6 @@ $aModule = [
'block' => 'theme_svg_icons',
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
],
// widget_product_list
[
'template' => 'widget/product/list.tpl',
'block' => 'widget_product_list',
'file' => '/Application/views/blocks/widget_product_list.tpl'
],
// details
[
'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_title',
'file' => '/Application/views/blocks/detail.tpl',
'position' => 150
],
// checkout
// view_cart
[
@ -68,6 +55,13 @@ $aModule = [
'block' => 'checkout_thankyou_main',
'file' => '/Application/views/blocks/checkout_s5.tpl'
],
// details
[
'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_title',
'file' => '/Application/views/blocks/view_item.tpl',
'position' => 150
],
// Lists
// view_item_list
[