[email protected] wrote:Hi,
I have tried adding the above given code at console as suggested, still no data is showing up in Analytics. Please help me to solve as it is very important.
So it means your google analytic ecommerce code it not working or the configuration of google analytic is not correct. The screen shot I share that is also a site of nopcommerce 3.4.
I am sharing the ecommerce analytic code:
1. Tracking code with {ECOMMERCE} line:
<!-- Google code for Analytics tracking -->
<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', '{GOOGLEID}', 'auto');
ga('send', 'pageview');
{ECOMMERCE}
</script>
2.Tracking code for {ECOMMERCE} part, with {DETAILS} line:
ga('require', 'ecommerce', 'ecommerce.js');
ga('ecommerce:addTransaction', {
'id': '{ORDERID}',
'affiliation': '{SITE}',
'revenue': '{TOTAL}',
'shipping': '{SHIP}',
'tax': '{TAX}'
});
{DETAILS}
ga('ecommerce:send');
3.Tracking code for {DETAILS} part:
ga('ecommerce:addItem', {
'id': '{ORDERID}',
'name': '{PRODUCTNAME}',
'sku': '{PRODUCTSKU}',
'category': '{CATEGORYNAME}',
'price': '{UNITPRICE}',
'quantity': '{QUANTITY}'
});