Google Tag Assistant reports 2 critical errors when tracking an transaction with Universal Analytics:
Error: Unknown method name: 'addTransaction'
Error: Missing 1 required parameter(s) for method 'send'.
The transaction is reported in Google Analytics but I'm worried about this errors. Here's my reporting code:
<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', {
'clientId': 'XXX'
});
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '5',
'affiliation': 'xxx',
'revenue': '0', // revenue is 0 because discount coupon was applied
'shipping': '15',
'currency': 'CHF'
});
ga('ecommerce:addItem', {
'id': '5',
'name': 'XXX',
'sku': '3387',
'price': '35.80',
'quantity': '1'
});
ga('ecommerce:send');
ga('send', 'pageview');
</script>
In Google Product Forum user Whims suggests to use
ga('send', 'ecommerce');
see: http://productforums.google.com/d/msg/analytics/L6bWIxPtNbA/PKUJLCfz6qsJ but there's nothing like this in developers docs.
I think you can ignore the complaints from Google Tag Assistant for now. AFAIK, tag assistant does not know about ecommerce and is throwing up a false positive.
Also, Please do NOT use ga('send', 'ecommerce');
that whims suggested. It will NOT send the data to GA servers correctly.
I see that this question has been open for quite some time, if the issue was resolved for you and the command ga('ecommerce:send');
worked for you, Please mark the answer as correct so that people looking at this do not get confused.