Hi,
I have tried to put the Google Analytics code in all the possible ways in the template: I have put it by code (in the head.php) in the place designed by the theme for it and by a plugin. In all the ways I have implemented it I have had the same problem: Google Analytics only show me few visits I have in the web. I have noticed I have lots of visits in diferent articles but Google Analytics does not recognize it. After doing diferent tests I can only think that the problem is in the template? can you check it? it is a pity, because I like a lot the template, but I need real statistics for it, so I would not like to change it. Can you give me another solution of implementation? thanks in advance.
Hi,
Please make sure you are entering the full analytics code in the required section in theme panel
– https://www.screencast.com/t/hpIAsdt7
The theme comes with a google analytics section where you can add the analytics code but there is one thing to take into consideration. Analytics provides 2 codes a short version and a long version. Most people use the short version and that is wrong. Please use the full version of the code in the analytics field, including the script tags and everything should work properly. Also clear any caching installed after you enter the code. Please note that it may take a little time before the statistics are refreshed.
Thanks
Dear Simion,
Thanks for your early answer.
Last week I put the code in the way you explain me but I didn’t work correctly. The page has more traffic than the one who says me Google Analytics. I think that the long code is this one:
<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’,’https://www.google-analytics.com/analytics.js’,’ga’);
ga(‘create’, ‘UA-xxxxxxxx-x’, ‘auto’);
ga(‘send’, ‘pageview’);
</script>
(I have change the numbers with xxx)
Is this the long code? Perhaps I am using a wrong one, but I don’t find anything else.
Thanks again for your help.
Alicia
Hi,
The code seems to be valid. Basically this code needs to be entered in the required section in theme panel and should work properly, after the initial processing time of up to 48 hours according to google. Try clearing any caching installed after adding the code and wait again for a period of time, this may vary. Maybe this article will help you troubleshoot if it is not tracking properly
– https://support.google.com/analytics/answer/1008083
Thanks
Dear Simion,
I have already tried the things you recommend and it seems that Google Analytics records correctly, but I continue with the problem.
I manage other pages with other templates and the statistic from the post viewer, the hosting statistics and the google analytics are very similar. But with this template I have the post statistics in a wrong way: the post in the page counter viewer and in the hosting statistics are also very similar, but in google analytics are wrong. For example, for the last post I put I have 1191 visitis in the page counter viewer, 1099 visits in the Hosting statistics and only 148 visits in Google Analytics. Furthermore I have the like Facebook in the post and the post has more likes than viewers in Google Analytics. So I know that Google Analytics is not counting correctly but I don’t know where the problem is.
Thanks again,
Alicia
Hi,
Maybe you are looking at a filtered result and that is why it shows inaccurate statistics
– https://support.google.com/analytics/answer/1009683?hl=en
I am just guessing here because I do not know what could be causing this issue. There clearly is a problem if the view counter is working properly, and somewhat matches your hosting results. There should not be such a huge difference between these statistics. The theme does not influence the analytics code as it is fully compatible with it.
Thanks