Hit counter issues

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 407
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Hit counter issues

Post by maestroc » Sat Apr 17, 2021 12:14 am

Any idea why or what circumstances might cause the Joomla article hit counts to be significantly different than what Google Analytics reports? We recently moved from a shared hosting account to a VPS and at that point the hit counts in Joomla started to be a lot less than those in GA.

Is it possible that Joomla is only counting uniques instead of all hits? It seems that all of the articles are reporting roughly 2/3 less hits in Joomla than in GA.

Thank you for any insight you might have on this.

User avatar
pe7er
Joomla! Master
Joomla! Master
Posts: 23055
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, Netherlands
Contact:

Re: Hit counter issues

Post by pe7er » Sat Apr 17, 2021 1:06 pm

Do you use server cache?
Do you use any Joomla cache?
Kind Regards,
Peter Martin, Global Moderator
https://db8.nl - Joomla specialist, Nijmegen, Nederland
The best website: https://the-best-website.com

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2312
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hit counter issues

Post by JAVesey » Sun Apr 18, 2021 9:36 am

maestroc wrote:
Sat Apr 17, 2021 12:14 am
Is it possible that Joomla is only counting uniques instead of all hits? It seems that all of the articles are reporting roughly 2/3 less hits in Joomla than in GA.
To legitimately compare one with the other you need to make sure that the two counts are using the same metrics.

It all rather depends upon what's being counted and over what time period.
John V
Cardiff, Wales, UK
Uses Joomla 3.9.26 and PHP7.4.16

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 407
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Hit counter issues

Post by maestroc » Sun Apr 18, 2021 8:04 pm

JAVesey wrote:
Sun Apr 18, 2021 9:36 am

It all rather depends upon what's being counted and over what time period.
Is it possible to limit what is counted in Joomla? Is there a setting for this somewhere?

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 407
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Hit counter issues

Post by maestroc » Sun Apr 18, 2021 8:09 pm

pe7er wrote:
Sat Apr 17, 2021 1:06 pm
Do you use server cache?
Do you use any Joomla cache?
No server cache is enabled.
I turned off Joomla cache months ago just in case that was the issue but it hasn't changed anything in terms of the difference in hit counts.

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 10164
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Hit counter issues

Post by sozzled » Mon Apr 19, 2021 12:05 am

Of course the hit counts will be different. Google Analytics uses a small piece of Javascript to see how many hits a web-page has (including hits from bots and non browser-based web agents) and Joomla uses PHP at the time a page view (from the com_content component) to update the hit count and store the value in the database. There's nothing particularly remarkable about this.

If you look at the PHP associated with com_content you can see where and how the database information is updated. If you want more information I suggest you ask a question at GitHub and see what the J! developers have to say. I don't have the time (or, perhaps, I don't have the inclination) to look at the PHP code for the com_content component to see how this is done and, besides, however it's done, if the author of the code is still around then they can answer it quicker than me.

I accept the difference in the hit count—between what GA says and what J! says—as a "fact". I don't have any confidence in the accuracy of those counts; they're indicators of which pages are being looked at by someone or something but the numbers, themselves, can be disputed. Page caching doesn't normally affect these counters unless people enable the System - Page Cache plugin (which should never be enabled unless you have web content that is never updated) and, even then, I don't know if enabling that plugin would make any difference.
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)


Post Reply

Return to “Administration Joomla! 3.x”