Analytics
3.5K members online now
3.5K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Ecommerce tracking not working

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

My ecommerce tracking doesn't work. I'm using a second different analytics profile to test it, but nothing shows up...

What's wrong with my tag ?

Thanks for your help

 

<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','https://www.google-analytics.com/analytics.js','ga');
			
	ga('create', 'UA-XXXXXXXX-2', 'auto','testec');
	ga('create', 'UA-XXXXXXXX-1', 'auto');
	ga('send', 'pageview');</script> 
</head>
<body>
<script>	ga('require', 'ec');
						
	ga('ec:addProduct', {
	'id': 25825, 
	'name': 'Servomoteur analogique miniature FS0403',
	'category': 'Servomoteurs miniatures', 
	'price': 4.8, 
	'quantity': 1
	});
	ga('ec:addProduct', {
	'id': 16790, 
	'name': 'Graveuse sur verre GG12',
	'category': 'Graveuses et pyrograveur', 
	'price': 12.9, 
	'quantity': 1
	});
	ga('ec:setAction','purchase', {
	'id': 328273,
	'affiliation': 'WEBSITE NAME', 
	'revenue': 23.6, 
	'shipping': 5.9,
	'tax': 3.9333333333333 
	});
	ga('testec.send', 'pageview');
</script>

 

1 Expert replyverified_user
Marked as Best Answer.
Solution
Accepted by topic author Johann C
April 2017

Ecommerce tracking not working

Top Contributor
# 2
Top Contributor

Hi @Johann C - you basically need to reference the new tracker:

ga('testec.require', 'ec');
ga('testec.ec:addProduct', {
 'id': 25825, 
 'name': 'Servomoteur analogique miniature FS0403',
 'category': 'Servomoteurs miniatures', 
 'price': 4.8, 
 'quantity': 1
 });
 ga('testec.ec:addProduct', {
 'id': 16790, 
 'name': 'Graveuse sur verre GG12',
 'category': 'Graveuses et pyrograveur', 
 'price': 12.9, 
 'quantity': 1
 });
 ga('testec.ec:setAction','purchase', {
 'id': 328273,
 'affiliation': 'WEBSITE NAME', 
 'revenue': 23.6, 
 'shipping': 5.9,
 'tax': 3.9333333333333 
 });
 ga('testec.send', 'pageview');


Web analyst @ escapestudio.net

Ecommerce tracking not working

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Damn ! I completely missed that... No wonder then ^^

Thanks a lot