Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently upgraded to (Google) Universal Analytics but since the upgrade no product information is appearing in my Conversions reports. But, transactions do appear as do all of the other usual Analytics data. It appears that the 'ecommerce:addTransaction' is working fine but the 'ecommerce:addItem' is having problems.

Here is the js that gets written out on the page:

  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', 'UA-XXXXXX-X', 'XXXXXXXXXXX.com');
  ga('send', 'pageview');

<!-- Analytics Conversions Tracking -->
ga('require', 'ecommerce', 'ecommerce.js');

ga('ecommerce:addTransaction', {
  'id': 'WEB7014997',                     // Transaction ID. Required
  'affiliation': 'NA',   // Affiliation or store name
  'revenue': '0.120000',               // Grand Total
  'shipping': '0.000000',                  // Shipping
  'tax': '0.020000'                     // Tax

ga('ecommerce:addItem', {
  'id': 'WEB7014997',                     // Transaction ID. Required
  'name': 'Test Product | Fresh Air',                // Product name. Required
  'sku': '9999999-99',                    // SKU/code
  'category': 'RT',       // Category or variation
  'price': '0.050000',                 // Unit price
  'quantity': '2.000000'                   // Quantity

ga('ecommerce:send');      // Send transaction and item data to Google Analytics.


In the above I have split the script tags so that the top part can appear on every page and then the bottom part just appears on the order confirmation page. I have tried combining into a single script tag but this didn't solve the problem.

Could the hyphen in the SKU or the number of decimal places in PRICE or QUANTITY be causing a problem? Or is there just a typo that I can't see?

Any help appreciated!


share|improve this question

migrated from stackoverflow.com Feb 3 '14 at 16:28

This question came from our site for professional and enthusiast programmers.

The dots or dashes shouldn't be a problem because they are properly wrapped in the single quotes. Have you tried it with Google Analytics debugger? chrome.google.com/webstore/detail/google-analytics-debugger/… – NicoM Jan 14 '14 at 19:16
No, but I will now! – johncross85 Jan 15 '14 at 11:30
Hmmm... no errors in the debugger but it does show this: analytics_debug.js:9 <unknown> (&ic) 9999999-99 analytics_debug.js:9 <unknown> (&in) Test Product | Fresh Air analytics_debug.js:9 <unknown> (&ip) 0.050000 analytics_debug.js:9 <unknown> (&iq) 1.000000 analytics_debug.js:9 <unknown> (&iv) RT analytics_debug.js:9 adSenseId (&a) 1188481922 analytics_debug.js:9 apiVersion (&v) 1 analytics_debug.js:9 – johncross85 Jan 21 '14 at 11:56
up vote 0 down vote accepted

John, everything seems to be fine except the number-formats. Make sure you include only 2 decimal places, with quantity being a whole number. I am pretty sure this might be causing the issues.

share|improve this answer
Okay, will try thanks. Annoyingly that is how the e-commerce platforms spits out the values. I guess I'll have to add in some javascript to round them off. – johncross85 Jan 20 '14 at 8:53
Simply JS should do... please let me know if this helped. :) – Petr Havlík Jan 20 '14 at 16:53
Ive added in the rounding off but it still looks like its messed up when I use GA Debug: analytics_debug.js:9 <unknown> (&ic) 9999999-99 analytics_debug.js:9 <unknown> (&in) Test Product | Fresh Air analytics_debug.js:9 <unknown> (&ip) 0.05 analytics_debug.js:9 <unknown> (&iq) 1 analytics_debug.js:9 <unknown> (&iv) RT analytics_debug.js:9 adSenseId (&a) 1064725295 analytics_debug.js:9 – johncross85 Jan 21 '14 at 12:13
Good grief, I wish I knew how to do line returns in comments!! – johncross85 Jan 21 '14 at 12:18
John, just send a link :) – Petr Havlík Jan 21 '14 at 13:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.