2023-01-10 14:22:49 +01:00
|
|
|
[{assign var="gtmProducts" value=$products}]
|
2023-05-10 15:01:56 +02:00
|
|
|
[{assign var="d3PriceObject" value=$gtmProducts->getPrice()}]
|
2023-01-10 14:22:49 +01:00
|
|
|
|
2023-01-11 15:54:52 +01:00
|
|
|
[{assign var="breadCrumb" value=''}]
|
|
|
|
|
2021-07-17 23:22:23 +02:00
|
|
|
[{if $gtmProducts|@count}]
|
|
|
|
[{strip}]
|
|
|
|
<script>
|
|
|
|
/* ga4 */
|
|
|
|
dataLayer.push({ecommerce: null});
|
|
|
|
dataLayer.push({
|
2023-01-10 14:22:49 +01:00
|
|
|
'event':'view_item_list',
|
2021-07-17 23:22:23 +02:00
|
|
|
'event_name': 'view_item_list',
|
|
|
|
'ecommerce': {
|
2023-01-11 15:54:52 +01:00
|
|
|
'item_list_id': '[{$oView->getCategoryId()}]',
|
2023-01-17 09:57:37 +01:00
|
|
|
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
2021-07-17 23:22:23 +02:00
|
|
|
'items': [
|
|
|
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
|
|
|
[{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")}]',
|
2023-05-10 15:01:56 +02:00
|
|
|
'price': [{$d3PriceObject->getPrice()}],
|
2021-07-17 23:22:23 +02:00
|
|
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
|
|
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
|
|
|
'quantity': 1
|
|
|
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
|
|
|
[{/foreach}]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
[{/strip}]
|
|
|
|
[{/if}]
|