Google Ecommerce
Hello,
I am trying to set up google ecommerce traking for my site.
I added the google tracking code to the receipt page of my site. Where I am a little confused is when I have to add variables to the javascript code in order to pass info (order id, product name, cost, etc) back to google.
Here is the script that google shows in their example:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
_gaq.push(['_addTrans',
'1234', // order ID - required
'Acme Clothing', // affiliation or store name
'11.99', // total - required
'1.29', // tax
'5', // shipping
'San Jose', // city
'California', // state or province
'USA' // country
]);
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
_gaq.push(['_addItem',
'1234', // order ID - required
'DD44', // SKU/code - required
'T-Shirt', // product name
'Green Medium', // category or variation
'11.99', // unit price - required
'1' // quantity - required
]);
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
I have searched on this question and all of the responses are vague and suggest that the cart vendor may have a list of variables. I am not sure if this is supported, if so, what are the variables and where would they be inserted in the js code to pass through correctly?
I also tried to search the forums but could not find anything close.
Thanks,
Rob