New Universal analytics code is not tracking in google analytics

153 views
Skip to first unread message

Murali Krishna

unread,
Nov 23, 2015, 7:42:39 AM11/23/15
to google-analytics-analyticsjs
Hi,

I  have update the code form old ga,js to new  analytics.js  from the developer network (https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce#implementation). 

After completion of a transaction I was able to see the transaction details in source code but these transaction details are not tracking in google analytics.

The following is the code that I am able to see in the source code on my confirmation page. Please review the below source code and let us know how to resolve it.


document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/analytics.js' type='text/javascript'%3E%3C/script%3E"));
try{
ga('create','UA-XXX','auto');
ga('send', 'pageview');
ga('require', 'ecommerce');

ga('ecommerce:addTransaction' , { 
'Id' : '167451',
 'affiliation' : XXX',
 'revenue' : '39.99',
 'shipping' : '8.99',
 'tax' : '2.80'
});
ga('ecommerce:addItem', {
'Id' : '167451',
 'name' : 'DryTech Basic V Neck Liner',
 'sku' : 'CB149',
 'category' : 'Cheer-InStockPracticeandTeamWear-WomensLongTops(GKEliteMasterCatalog)',
 'price' : '39.9900',
 'quantity' : '1'
 });
ga('ecommerce:send');

Peter Pham

unread,
Nov 23, 2015, 3:38:25 PM11/23/15
to google-analytics-analyticsjs
I think "Id" is incorrect. It should be lower case as "id"
This might have cause your transaction invalid.
Reply all
Reply to author
Forward
0 new messages