Analytics
3.3K members online now
3.3K 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

Problem Universal Analytics tracking code

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm using Universal Analytics tracking code in my e-commerce website.

 

About 12% of my conversions are not tracked properly by Google Analytics.

 

Here is my code tracking code : 

(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-XXXXX-1', 'auto'); ga('send', 'pageview');ga('require', 'ecommerce', 'ecommerce.js'); ga('ecommerce:addTransaction', { 'id': '95753', 'affiliation': 'Cartouche encre biz', 'revenue': '3.31', 'shipping': '4.91', 'tax': '0.55' });ga('ecommerce:addItem', { 'id': '95753', 'name': 'Cartouche dencre Compatible pour imprimante Canon Pixma MP500 - Pixma MP 500 - Noir Haute Capacité', 'sku': '94096', 'category': 'Pixma MP 500', 'price': '1.66', 'quantity': '2' });ga('ecommerce:send'); 

Can you help where is the error in my tracking code?

 

Is it typical that some of the conversions are not tracked properly ? If yes, does 12% seem to be a too huge number compared to the industry average ? My manager, who is not a coder tells me he can't accept a difference of more than 2 or 3% between the actual sales, and the sales tracked by analytics.

 

Thanks in advance.

1 Expert replyverified_user

Re: Problem Universal Analytics tracking code

Top Contributor
# 2
Top Contributor
Hi Karima,

You tracking code is OK, there are no errors in it. Possible causes of the missing conversions are the user never reaches your order confirmation page or when they close the browser before the transaction code is fired. There can be other resources on the order confirmation page that delay firing the transaction code.
You can check the number of page views for your order confirmation page in Behaviour -> Site Content -> All pages and do a search for your order confirmation page. Are you getting the correct number of hits?
You can check if your code is working properly on the order confirmation page using the GA Debugger and Google Tag Assistant Chrome plugins. Hope this helps.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Problem Universal Analytics tracking code

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Arnold,

Thanks for your quickly response.

I checked the number of page views for my order confirmation page in Behaviour -> Site Content -> All pages and i have not obtained the correct number of hits, about 12% of my conversions are not tracked properly by Google Analytics.

I used the GA Debugger and Google Tag Assistant Chrome plugins, and it has not display error.

I made a function test in my order confirmation page to return an email when the user reaches the success page. So i m sure that the users don't close the browser before the transaction code is sent.

There must be something else. Do you have any idea what it could be ?

I really need to find a solution to this issue, as my manager, who is not a coder tells me he can't accept a difference of more than 2 or 3% between the actual sales, and the sales tracked by analytics.

Thanks in advance.

Re: Problem Universal Analytics tracking code

Top Contributor
# 4
Top Contributor
Hi Karima,

You say that you're not getting the correct number of hits to the confirmation page in Behaviour -> Site Content -> All pages. The transaction code is only fired for the users who reach the confirmation page. Basically the nr. of unique pageviews for the confirmation page should be equal to the number of transactions in GA for a given period. You need to make sure that all of the users reach the confirmation page after the purchase. How the number of emails you get from the confirmation page compares with the number of purchases?

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Problem Universal Analytics tracking code

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Hi Arnold,

 

For more clarification,

I put the tracking code in all the pages of my site except page after purchase :

(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-XXXXX-1', 'auto');
ga('require', 'displayfeatures');
ga('send', 'pageview'); 


So I put this tracking code in the page after purchase:
 

(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-XXXXX-1', 'auto'); ga('send', 'pageview');ga('require', 'ecommerce', 'ecommerce.js'); ga('ecommerce:addTransaction', { 'id': '95753', 'affiliation': 'Cartouche encre biz', 'revenue': '3.31', 'shipping': '4.91', 'tax': '0.55' });ga('ecommerce:addItem', { 'id': '95753', 'name': 'Cartouche dencre Compatible pour imprimante Canon Pixma MP500 - Pixma MP 500 - Noir Haute Capacité', 'sku': '94096', 'category': 'Pixma MP 500', 'price': '1.66', 'quantity': '2' });ga('ecommerce:send');

To verify that the customer will access the command successfully page, I put a test function that returns me an email each time the customer will end its payment process

the number of emails received is equal to the number of orders inserted into my table orders. But there's 12% of these orders are not followed in google.

 

Thank you in advance for your help!

Re: Problem Universal Analytics tracking code

Top Contributor
# 6
Top Contributor
Hi Karima,

As I mentioned above the tracking code is ok. Can you post the whole source code of the confirmation page so I can check if there are no conflicts? Thanks.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital