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:
<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-XXXXXX-X', 'XXXXXXXXXXX.com');
ga('send', 'pageview');
</script>
<!-- Analytics Conversions Tracking -->
<script>
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.
</script>
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!
John