Created
July 5, 2012 05:39
-
-
Save scottcorgan/3051569 to your computer and use it in GitHub Desktop.
Google Analytics Ecommerce Tracking
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
// | |
// We add this once for each transaction | |
// | |
_gaq.push(['_addTrans', | |
'1234', // order ID - required | |
'Womens Apparel', // affiliation or store name | |
'28.28', // total - required | |
'1.29', // tax | |
'15.00', // shipping | |
'San Jose', // city | |
'California', // state or province | |
'USA' // country | |
]); | |
// | |
// Now we add an item for each item purchased | |
// | |
_gaq.push(['_addItem', | |
'1234', // order ID - necessary to associate item with transaction | |
'DD44', // SKU/code - required | |
'T-Shirt', // product name | |
'Olive Medium', // category or variation | |
'11.99', // unit price - required | |
'1' // quantity - required | |
]); | |
_gaq.push(['_trackTrans']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment