Huge difference: Piwik vs Google Analytics

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 || [];
	(function() {
		var u="//";
		_paq.push(['setTrackerUrl', u+'s/']);
		_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);
<noscript><p><img src="//" 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;
	access_log on;
	access_log /opt/nginx/logs/;

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

python2 /var/www/ --url= --idsite=2 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots /opt/nginx/logs/

and these are the results:

Google Analytics


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: