Created
May 25, 2019 07:21
-
-
Save karthik20522/a19b3954c6874c73c66d99677d8dd7ca to your computer and use it in GitHub Desktop.
shopify cart tracking
This file contains hidden or 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 type="text/javascript"> | |
var productsArray = []; | |
{% for item in cart.items %} | |
item = { | |
'sku': '{{ item.sku }}', | |
'price': {{ item.price | money_without_currency }}, | |
'size': '{{ item.variant.option2 }}', | |
'quantity': {{ item.quantity }} | |
} | |
productsArray.push( item ); | |
{% endfor %} | |
var shpfy_track = { | |
type: "bucket", | |
products: productsArray | |
}; | |
</script> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment