3

What seems to be the case why this code is not working.

The account is set to Universal Analytics.

The account is enabled for ecommerce.

The chrome extension for debugging analytics shows a lot of stuff is happening.

But days pass by and no tracking.

Here is the output:

(Note: Account and domain data is substituted for this public post.)

<!-- BOF: Google Analytics E-commerce Tracking -->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-00000000-0', 'my.domain.com');

  ga('require', 'ecommerce', 'ecommerce.js');

  ga('ecommerce:addTransaction', {
    'id': '12345',
    'affiliation': 'My Store',
    'revenue': '200',
    'shipping': '0',
    'tax': '40',
    'currencyCode': 'EUR'
  });

  ga('ecommerce:addItem', {
    'id': '00001',
    'name': 'Item 1',
    'sku': 'V4C3D5R2Z6',
    'category': 'stuff',
    'price': '80',
    'quantity': '2'
  });

  ga('ecommerce:send');
</script>
<!-- EOF: Google Analytics E-commerce Tracking -->

Further below on the page there is the standard pageview.

<!-- BOF: Universal Analytics -->
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-00000000-0', 'my.domain.com');
  ga('send', 'pageview');
</script>
<!-- EOF: Universal Analytics -->
1
  • I changed so the item price includes tax. The documentation doesnt say which one but the example seems so. Still nothing though. Does it take a day to see the changes or is it immediate?
    – tim
    Aug 13, 2013 at 9:50

1 Answer 1

0

It seems the ecommerce code is in conflict with the regular tracking code. Using the multiple tracker method would solve the case.

ga('create', 'UA-00000000-0', {'name': 'myTracker'});

...
1
  • Even if it weren't in conflict now, my understanding is that Google is going to move all tracking over to universal eventually. At that point, it would probably stop working. Dec 5, 2013 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.