Variables needed to populate ECommerce in Google Analytics
Hi Folks,
Im needing to track ecommerce transactions from my web site via Google Analytics and below is the script for Google Analytics.
Ive put in the variables I think are needed based on the cartname.php script in the WA_eCart folder (attached) but they dont seem to work.
Can you advise where i can find the correct variables I need.
below is the analytics script (ive replaced my tracking number for privacy)
<!-- Begin Google Analytics code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='plugins/" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXX-6");
pageTracker._trackPageview();
pageTracker._addTrans(
"$orderid", // Order ID
"", // Affiliation
"$TotalPrice", // Total
"", // Tax
"", // Shipping
"$ship_city", // City
"", // State
"$ship_country" // Country
);
pageTracker._addItem(
"$orderid", // Order ID
"$itemSKU", // SKU
"$itemName", // Product Name
"", // Category
"$itemPrice", // Price
"$itemQuantity" // Quantity
);
pageTracker._trackTrans();
} catch(err) {}
</script>
<!--/Google Analytics-->
The $ ive put in are based on what i think i should be using from the cartname.php script.
Ive attached the script from the WA_eCart folder as well.
Thanks
Paul