Go to Settings > Checkout > Attional Scripts > Order status page.
Fill in YOUR CONTAINER ID
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | |
})(window,document,'script','dataLayer','YOUR CONTAINER ID');</script> | |
<!-- End Google Tag Manager --> | |
<script> | |
window.dataLayer.push({ | |
event: "eec.purchase", | |
ecommerce: { | |
currencyCode: "{{ currency }}", | |
purchase: { | |
actionField: { | |
id: "{{ order_number }}", | |
affiliation: "{{shop.name}}", | |
revenue:'{{checkout.total_price | money_without_currency| remove: ","}}', | |
tax: '{{checkout.tax_price | money_without_currency| remove: ","}}', | |
shipping: '{{checkout.shipping_price | money_without_currency| remove: ","}}', | |
}, | |
products: [ | |
{% for line_item in line_items %} | |
{ | |
id: "{{ line_item.sku }}", | |
name: "{{line_item.title}}", | |
quantity: "{{line_item.quantity}}", | |
brand: "{{shop.name}}", | |
price: '{{line_item.price | money_without_currency | remove: ","}}', | |
}, | |
{% endfor %} | |
], | |
}, | |
}, | |
}); | |
</script> |