2023-03-20 09:49:49 +01:00
|
|
|
[{$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. */
|
2023-06-21 14:24:47 +02:00
|
|
|
|
2023-03-20 09:49:49 +01:00
|
|
|
dataLayer.push({
|
|
|
|
'event': 'view_item',
|
|
|
|
'eventLabel':'Product View',
|
|
|
|
'ecommerce': {
|
|
|
|
'currency': '[{$currency->name}]',
|
|
|
|
'items': [
|
|
|
|
{
|
2023-05-10 15:01:56 +02:00
|
|
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
|
|
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
2023-03-20 09:49:49 +01:00
|
|
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
2023-05-10 15:01:56 +02:00
|
|
|
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
|
2023-06-27 12:15:21 +02:00
|
|
|
[{if $gtmBasketItemCategory}]
|
2023-06-21 15:29:27 +02:00
|
|
|
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
|
|
|
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
|
|
|
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
|
|
|
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
2023-06-21 15:45:12 +02:00
|
|
|
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
2023-06-27 12:15:21 +02:00
|
|
|
[{/if}]
|
2023-05-10 15:01:56 +02:00
|
|
|
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
|
|
|
'price': [{$d3PriceObject->getPrice()}]
|
2023-03-20 09:49:49 +01:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|