Created
November 2, 2016 18:45
-
-
Save arturodz/a4e0b871657fe0cf00b2c0a6da5e8f34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
window.dataLayer = window.dataLayer || []; | |
dataLayer.push({ | |
‘event’ : ‘transactionComplete’, | |
‘transactionId’: ‘{{order.order_number}}’, | |
‘transactionTotal’: {{total_price | times: 0.01}}, | |
‘transactionTax’: {{tax_price | times: 0.01}}, | |
‘transactionShipping’: {{shipping_price | times: 0.01}}, | |
‘transactionProducts’: [ | |
{% for line_item in line_items %} | |
{ | |
‘sku’: ‘{{line_item.sku}}’, | |
‘name’: ‘{{line_item.title}}’, | |
‘category’: ‘{{line_item.type}}’, | |
‘price’: {{line_item.line_price | times: 0.01}}, | |
‘quantity’: {{line_item.quantity}} | |
}, | |
{% endfor %}] | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment