Huge difference: Piwik vs Google Analytics

Hello,
I’m using piwik (latest version) along with google analytics.

These are the last 30 days on google analytics:

and these are the last 30 days on piwik:

the difference is huge! Why?
I thought it was a problem with adblock, so I did a url rewrite of piwik url, like this:

<!--- Piwik --->
<script type="text/javascript">
	var _paq = _paq || [];
	_paq.push(['trackPageView']);
	_paq.push(['enableLinkTracking']);
	(function() {
		var u="//stats.mywebsite.it/";
		_paq.push(['setTrackerUrl', u+'s/sp.cf']);
		_paq.push(['setSiteId', 1]);
		var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
		g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'s/sj.js'; s.parentNode.insertBefore(g,s);
	})();
</script>
<noscript><p><img src="//stats.mywebsite.it/s/sp.cf?idsite=1" style="border:0;" alt="" /></p></noscript>
<!--- End Piwik Code --->

but I have not solved. Do you have tips for me?

can someone help me? ,:sweat:

Please compare the Piwik graph with the “Utenti” graph. Is it still broken?
It happened to me that I compared two different things and wonder why GA had a higher count.

Besides: Piwik might show up to 10% less than GA - this happens to me all the time.

I compare the right things…
Now I have also tried to do the most simple comparison: page views.
look what is the difference:


I did some side-by-side tests of Piwik and GA a couple years ago, and GA was so incorrect that I stopped using it entirely. The GA results were just so wrong that I couldn’t trust any of their numbers anymore.

I’m not saying that’s what’s happening here, but in my personal experience, when the numbers between Piwik and GA differed, Piwik was much more accurate.

at this point I’ll try to do a monitoring server logs and see the difference… :confounded:

I’ve set up GA for several non Wordpress pages on my domain, and Piwik as well.
GA shows a lot of inaccuracy, sometimes not recognising my own visits.

In the day of October 12 I enabled the nginx log like this:
(Of course, before I removed the js code from all web pages)

server {
	listen 80;
	server_name blog.website.it;
	
	
	access_log on;
	access_log /opt/nginx/logs/blog.website.it/access.log;
	
	[...]
	
}

Today I imported the nginx log in piwik. in this way:

python2 /var/www/stats.website.it/misc/log-analytics/import_logs.py --url=https://stats.website.it --idsite=2 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots /opt/nginx/logs/blog.website.it/access.log

and these are the results:

Google Analytics

Piwik

I do not know what to think anymore… :scream:

Nothing… I have deleted piwik and I switched to a log analyzer server side (GoAccess).
Now I have much more truthful statistics! :heart_eyes:

Whilst GoAccess would be fine for a single server back end application (eg. all PHP based) it misses on a few points. In my situation I have servers behind a load balancer and a javascript one page application. GoAccess
would not work for me. As our web site is for an intranet and can’t be accessed outside our network, Google Analytics can’t work either (And I don’t really want Google getting our statistics either). Also, GoAccess can’t track user actions nor button clicks etc in a JS app (And who doesn’t use some JS on their web pages nowadays).

No problem. For what you can not do with GoAccess it does with GoogleAnalytics.

What interested me the most, are the real visitors. :wink: