Created
April 27, 2010 10:53
-
-
Save etianen/380617 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
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-XXXXX-X']); | |
_gaq.push(['_trackPageview']); | |
_gaq.push(['_addTrans', | |
'<?php echo $orderId; ?>', // order ID - required | |
'<?php echo $storeName; ?>', // affiliation or store name | |
'<?php echo $total; ?>', // total - required | |
'<?php echo $tax; ?>', // tax | |
'<?php echo $shipping; ?>', // shipping | |
'<?php echo $city; ?>', // city | |
'<?php echo $state; ?>', // state or province | |
'<?php echo $country; ?>' // country | |
]); | |
_gaq.push(['_addItem', | |
'<?php echo $orderId; ?>', // order ID - required | |
'<?php echo $productId; ?>', // SKU/code | |
'<?php echo $productName; ?>', // product name | |
'<?php echo $variant; ?>', // category or variation | |
'<?php echo $price; ?>', // unit price - required | |
'<?php echo $quantity; ?>' // quantity - required | |
]); | |
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment