2023-05-23 10:06:21 +02:00
|
|
|
[{$smarty.block.parent}]
|
2023-05-31 10:17:51 +02:00
|
|
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
2023-06-21 14:19:48 +02:00
|
|
|
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
|
2023-05-23 10:06:21 +02:00
|
|
|
|
|
|
|
[{assign var="breadCrumb" value=''}]
|
|
|
|
|
2023-08-03 15:55:07 +02:00
|
|
|
[{block name="d3_ga4_view_item_list_block"}]
|
|
|
|
[{if $gtmProducts|@count}]
|
|
|
|
[{capture assign=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)}]',
|
|
|
|
'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}]
|
|
|
|
]
|
2023-08-16 10:44:50 +02:00
|
|
|
}[{if $oViewConf->isDebugModeOn()}],
|
|
|
|
'debug_mode': 'true'
|
|
|
|
[{/if}]
|
2023-08-03 15:55:07 +02:00
|
|
|
});
|
|
|
|
[{/strip}]
|
|
|
|
[{/capture}]
|
|
|
|
[{oxscript add=$d3_ga4_view_item_list}]
|
|
|
|
[{/if}]
|
|
|
|
[{/block}]
|