Analytics
2.8K members online now
2.8K 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: Transaction value showing zero

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I seem to have a problem with ecommerce tracking. It is tracking transactions, however the transaction value is always showing as zero.

 

Strangely, everything including values is pulling through on the 'Product Performance' tab.

 

Can anyone help with this? Below is the tracking code implement on the success page:

 

<!-- Google 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-XXXXXXXX-1', 'auto');
ga('require', 'ecommerce');
ga('ecommerce:addItem', {
'id': '29207', // Transaction ID. Required.
'name': 'YYYYYYYY', // Product name. Required.
'sku': '29207_11-04-16', // SKU/code.
'category': 'Destination booking', // Category or variation.
'price': '299', // Unit price.
'quantity': '1', // Quantity.
'currency': 'GBP' // local currency code.

});
ga('ecommerce:send');
ga('ecommerce:clear');
</script>
<!-- End Google Analytics -->

Re: Ecommerce Tracking: Transaction value showing zero

[ Edited ]
Follower ✭ ✭ ✭
# 2
Follower ✭ ✭ ✭

I don't see a transaction object sent in the code.

You should have something like:


ga('ecommerce:addTransaction', {
'id': '1234',
'affiliation': 'XXX',
'revenue': '299',
'shipping': '5',
'tax': '1.29',
'currency': 'GBP' // local currency code.
});


BEFORE ga('ecommerce:send');

Otherwise it gets cleared.

 

Refer to this article for implementation details

https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce