Hello,
THere have been several threads posted about inserting tracking cookies & I've managed to do mine without too much hassle. I haven't, however, had eCommerce tracking running and would like to add it.
I'm told I have to add:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._addTrans(
"1234", // Order ID
"Mountain View", // Affiliation
"11.99", // Total
"1.29", // Tax
"5", // Shipping
"San Jose", // City
"California", // State
"USA" // Country
);
pageTracker._addItem(
"1234", // Order ID
"DD44", // SKU
"T-Shirt", // Product Name
"Green Medium", // Category
"11.99", // Price
"1" // Quantity
But what are the variables I replace the example figures with?
I have looked at other posts but they seem to refer to a legacy version of Google Analytics and that's why I'm asking again.
Sam
THere have been several threads posted about inserting tracking cookies & I've managed to do mine without too much hassle. I haven't, however, had eCommerce tracking running and would like to add it.
I'm told I have to add:
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-XXXXX-1");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._addTrans(
"1234", // Order ID
"Mountain View", // Affiliation
"11.99", // Total
"1.29", // Tax
"5", // Shipping
"San Jose", // City
"California", // State
"USA" // Country
);
pageTracker._addItem(
"1234", // Order ID
"DD44", // SKU
"T-Shirt", // Product Name
"Green Medium", // Category
"11.99", // Price
"1" // Quantity
But what are the variables I replace the example figures with?
I have looked at other posts but they seem to refer to a legacy version of Google Analytics and that's why I'm asking again.
Sam
Comment