Created
September 9, 2010 12:27
-
-
Save matthewfitz/571804 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
{% if thankspage %} | |
// Transaction | |
_gaq.push(['ShopOpenSkyTracker._addTrans', | |
'{{ order.orderNumber|escape('js') }}', | |
'{{ _view.user.getAttribute('checkout/referrerName')|escape('js') }}', | |
'{{ order.grandTotal|escape('js') }}', | |
'{{ order.taxAmount|escape('js') }}', | |
'{{ order.shippingAmount|escape('js') }}', | |
'{{ order.billingAddress.city|escape('js') }}', | |
'{{ order.billingAddress.state|escape('js') }}', | |
'US' | |
]); | |
// Items purchased | |
{% for item in order.items %} | |
_gaq.push(['ShopOpenSkyTracker._addItem', | |
'{{ order.orderNumber|escape('js') }}', // order ID - necessary to associate item with transaction | |
'{{ item.stockItem.openSkySku|escape('js') }}', // SKU/code - required | |
'{{ item.product.name|escape('js') }}', // product name | |
'', // category or variation | |
'{{ item.product.price|escape('js') }}', // unit price - required | |
'{{ item.qtyOrdered|escape('js') }}' // quantity - required | |
]); | |
{% endfor %} | |
_gaq.push(['ShopOpenSkyTracker._trackTrans']); | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment