Hire a web Developer and Designer to upgrade and boost your online presence with cutting edge Technologies

Monday, October 8, 2012

How To - Volusions Google Analytics eCommerce Tracking

Volusion are very secretive about how to integrate analytics ecommerce tracking into your volusion store.

Here is how to do it.

Make sure that the standard analytics code is just before the body closing tag.

Next put the following snippet in article 130 in the CMS section:



<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'your analytics code']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_addTrans',
    Order[0],           // order ID - required
    'Store Name',  // affiliation or store name
    Order[2],          // total - required
    Order[4],           // tax
    Order[5],              // shipping
    Order[6],       // city
    Order[7],     // state or province
    Order[8]             // 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
  for(i in OrderDetails){
  _gaq.push(['_addItem',
    OrderDetails[i][0],           // order ID - required
    OrderDetails[i][2],           // SKU/code - required
    OrderDetails[i][3],        // product name
    '',   // category or variation
    OrderDetails[i][5],          // unit price - required
    OrderDetails[i][6]               // 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>

Make sure that you have eCommerce enabled in your analytics account

No comments:

Post a Comment