E commerce Tracking is not working in nopCommerce 3.40

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hello,

Since 3 days I am trying to configure ecommerce tracking for analytics and did follow all the steps given in the thread: https://www.nopcommerce.com/boards/t/32329/340-step-by-step-how-to-configure-google-analytics-widget.aspx . I have placed same Google universal analytics code as given in thread. Also, did enable Ecommerce set-up under Ecommerce settings in Analytics. But nothing worked. Please tell me do I need to change any code?

I have tested by placing an order but data is not reflecting in Analycaltic ecommerce overview. Am I doing anything wrong? please guide me. Check the screenshot below.



8 years ago
Did you checked "Disable "Order completed" page" in Configurations--> Settings --> Order Setting ?

if yes then, you have to unchecked because E-commerce tracking code depends on this page.
8 years ago
SuperNopCommerce wrote:
Did you checked "Disable "Order completed" page" in Configurations--> Settings --> Order Setting ?

if yes then, you have to unchecked because E-commerce tracking code depends on this page.


Yes, I have unchecked it too. What might be the issue? Is coding part correct?
8 years ago
[email protected] wrote:
Did you checked "Disable "Order completed" page" in Configurations--> Settings --> Order Setting ?

if yes then, you have to unchecked because E-commerce tracking code depends on this page.

Yes, I have unchecked it too. What might be the issue? Is coding part correct?


Did you modify any default code of nopcommerce?
8 years ago
SuperNopCommerce wrote:
Did you checked "Disable "Order completed" page" in Configurations--> Settings --> Order Setting ?

if yes then, you have to unchecked because E-commerce tracking code depends on this page.

Yes, I have unchecked it too. What might be the issue? Is coding part correct?

Did you modify any default code of nopcommerce?


With the default nopcommerce code it was not working. So, I have changed the code to as suggested in the thread: https://www.nopcommerce.com/boards/t/32329/340-step-by-step-how-to-configure-google-analytics-widget.aspx
8 years ago


Please browse your web site and at console write

ga('ecommerce:addItem', {
  'id': '1234',                     // Transaction ID. Required.
  'name': 'Fluffy Pink Bunnies',    // Product name. Required.
  'sku': 'DD23444',                 // SKU/code.
  'category': 'Party Toys',         // Category or variation.
  'price': '11.99',                 // Unit price.
  'quantity': '1'                   // Quantity.
});
ga('ecommerce:send');

and hit enter if it show at your google analytic then you need to do some work at checkout page.
7 years ago
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.
7 years ago
[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}'
});
7 years ago
sina.islam 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}'
});


Hi, I have added the above code, placed one test order. Does it take some time to reflect the data in Analytics account?
7 years ago
Yes it takes little time 1 or 2 minutes maximum but not more than that. Now for confirmation, that the analytic code is working. please do the same as I told at browser console. If it is not working for your site's products.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.