views:

11

answers:

0

Hello,

I am trying to set up google ecommerce tracking code, I have followed google examples but It doesnt seem to be having any effect on their site.

Does this code look correct?

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXX-X']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['_addTrans',
            '1-112461-1277737839', //unique order id
            'www.domain-name.com', //domain
            '5.00' //gateway amount
  ]);

   // 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',
            '1-112461-1277737839', //unique order id
            '', // transaction id
            'Credits',  //product name
            'GBP', //Variation: currency name
            '5.00', // unit price
            '1' //quantity
  ]);
  _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);
  })();