Volusion is very secretive about how to integrate analytics ecommerce tracking into your volusion store; paying them $150/hour because, A) you can’t do it yourself or B) you don’t want to, is what they’re hoping for. In fact, the same is true with mostly any customization of their code as well.
About a month ago, I came across some code, but it used older Google Analytics tracking code. As there is nothing wrong with it, it works just fine, the problem was that if I wanted to do anything else with Google Analytics, ie. track events with:
onClick="_gaq.push(['_trackEvent','Main Menu','Click','Baby Strollers']);"
… it wouldn’t work.
So, I took the code and made it compatible with the Asynchronous JavaScript version of Google Analytics to track both Visitors & E-Commerce conversions.
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25344799-1']);
_gaq.push(['_setDomainName', 'ledsplus.com']);
_gaq.push(['_trackPageview']);
if ( typeof Order !== 'undefined' ) {
_gaq.push(['_addTrans',Order[0], '', Order[2], Order[4], Order[5], Order[6], Order[7], Order[8]]);
for (var i=0; i<OrderDetails.length; i++) {
_gaq.push(['_addItem',OrderDetails[i][0], OrderDetails[i][2], OrderDetails[i][3], OrderDetails[i][4], OrderDetails[i][5], OrderDetails[i][6]]);
}
_gaq.push(['_trackTrans']);
}
(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>
Here’s what my template_xxx.html page looks like (I put my code just before the </body> tag:
Once you’re done and had some actual conversions happen on your site, you should be able to see this in your Google Analytics account under E-Commerce > Overview:
Leave a Reply