GoogleAnalytics4/Application/views/ua/s5_thankyou.tpl

45 lines
2.1 KiB
Smarty
Raw Normal View History

2018-07-04 15:47:37 +02:00
<script>
[{*
dataLayer.push({
'event': 'ee.checkout',
'eventLabel':'Checkout 5',
'ecommerce': {'checkout': {'actionField': {'step': 5}}}
});
*}]
[{assign var="_gtmOrder" value=$oView->getOrder()}]
2021-07-17 23:22:23 +02:00
[{assign var="_gtmBasket" value=$_gtmOrder->getBasket()}]
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}]
2018-07-04 15:47:37 +02:00
dataLayer.push({
'event': 'ee.transaction',
'eventLabel':'[{oxmultilang ident="ORDER_COMPLETED"}]',
'ecommerce': {
'purchase': {
'actionField': {
'id':'[{$_gtmOrder->oxorder__oxordernr->value}]',
'affiliation':'[{$oxcmp_shop->oxshops__oxname->value}]',
'revenue':'[{$_gtmOrder->oxorder__oxtotalordersum->value}]',
'tax':'[{math equation="x+y" x=$_gtmOrder->oxorder__oxartvatprice1->value y=$_gtmOrder->oxorder__oxartvatprice2->value }]',
'shipping':'[{$_gtmOrder->oxorder__oxdelcost->value}]'
/*'coupon':'CANO25' //if a coupon code was used for this order*/
},
'products':[
[{foreach key="_index" from=$_gtmBasket->getContents() item="_gtmBasketitem" name="gtmTransactionProducts"}]
2018-12-14 16:09:41 +01:00
[{assign var="_price" value=$_gtmBasketitem->getPrice()}]
2018-07-04 15:47:37 +02:00
{
'id':'[{$_gtmArticles[$_index]->oxarticles__oxartnum->value}]',
'name': '[{$_gtmArticles[$_index]->oxarticles__oxtitle->value}]',
'variant':'[{$_gtmArticles[$_index]->oxarticles__oxvarselect->value}]',
2018-12-04 15:53:10 +01:00
'price': [{$_price->getPrice()}],
'item_price': [{$_price->getPrice()}],
2018-07-04 15:47:37 +02:00
'quantity':[{$_gtmBasketitem->getAmount()}],
2018-12-04 15:53:10 +01:00
'position':[{$smarty.foreach.gtmTransactionProducts.iteration}]
2018-07-04 15:47:37 +02:00
}[{if !$smarty.foreach.gtmTransactionProducts.last}],[{/if}]
[{/foreach}]
]
}
}
});
</script>
2018-12-14 16:09:41 +01:00
[{$smarty.block.parent}]