2023-05-23 10:49:05 +02:00
|
|
|
[{$smarty.block.parent}]
|
2023-05-31 10:17:51 +02:00
|
|
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
2023-06-26 17:41:00 +02:00
|
|
|
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
|
2023-01-10 14:22:49 +01:00
|
|
|
|
2023-01-11 15:54:52 +01:00
|
|
|
[{assign var="breadCrumb" value=''}]
|
|
|
|
|
2023-08-17 08:50:15 +02:00
|
|
|
[{block name="d3_ga4_view_item_list_block"}]
|
|
|
|
[{if $gtmProducts|@count}]
|
2023-12-18 11:59:12 +01:00
|
|
|
[{capture name="d3_ga4_view_item_list"}]
|
2023-08-17 08:50:15 +02:00
|
|
|
[{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)}]',
|
|
|
|
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
|
|
|
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
|
|
|
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
|
|
|
[{/if}]
|
|
|
|
'quantity': 1
|
|
|
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
|
|
|
[{/foreach}]
|
|
|
|
]
|
|
|
|
}[{if $oViewConf->isDebugModeOn()}],
|
|
|
|
'debug_mode': 'true'
|
|
|
|
[{/if}]
|
|
|
|
});
|
|
|
|
[{/strip}]
|
|
|
|
[{/capture}]
|
2023-12-18 11:59:12 +01:00
|
|
|
[{oxscript add=$smarty.capture.d3_ga4_view_item_list}]
|
2023-08-17 08:50:15 +02:00
|
|
|
[{/if}]
|
|
|
|
[{/block}]
|