matomo-org / matomo-for-wordpress

Get a fully functioning Matomo Analytics for your WordPress. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Privacy is built-in. 100% data ownership, no one else can see your data. We love Pull Requests!
https://matomo.org
GNU General Public License v3.0
119 stars 25 forks source link

Statistics not showing #1185

Open Saffronbunny opened 2 months ago

Saffronbunny commented 2 months ago

I don't have any visitors registered in the last few months. I can only see there are visitors registered in the last 24 hours in real time and visitors logg, but apparently they aren't archived.

Archiving ran successfully the last time: 12 june 2024 13:07:14.

I include the errors an reports I find.

Matomo Cron Error

An error occurred during Matomo archiving. See error details in the Diagnostics page.

DIAGNOSTICS

Matomo Archive Warnings: 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2024-08-14&format=json&trigger=archivephp. Response was \'<!DOCTYPE html> <html dir=\'ltr\'>

Matomo system report.txt

diosmosis commented 2 months ago

Hi @Saffronbunny, it looks like something changed with your server configuration that affects the PHP CLI setup. Specifically, when loading WordPress through PHP CLI (which is done by default when archiving reports), there appears to be an failure in loading redis, causing a failure. (The specific error message is in the system report as Error establishing a Redis connection</h1> <p>To disable Redis, delete the <code>object-cache.php</code> file in the <code>/wp-content/</code> directory..

Resolving the error with redis should solve the problem (you may need to contact your hosting provider to fix this unless you are able to change the server configuration yourself). Alternatively, you can try enabling archiving via HTTP requests in Matomo Analytics > Settings > Advanced (note that the only reason you wouldn't want to do this is if your website has a lot of traffic).

Saffronbunny commented 2 months ago

Hi! Thanks!

  1. Looking through the settings now, I realized I had added a manual tracking code. I might have done this to send the data to a server install of Matomo I did myself. I'm not quite sure. So I'm thinking I could first try to change to default tracking. Do you think this might fix it?

  2. If this doesn't work I can try enabling archiving via HTTP. Not a lot of traffic on this site. BTW - what would be "lot of traffic" in this case?

  3. Are these the settings I want if I activate HTTP requests? - See attached.

Skärmavbild 2024-08-15 kl  10 35 19

diosmosis commented 2 months ago

Looking through the settings now, I realized I had added a manual tracking code. I might have done this to send the data to a server install of Matomo I did myself. I'm not quite sure. So I'm thinking I could first try to change to default tracking. Do you think this might fix it?

No, this shouldn't affect the error you're seeing.

If this doesn't work I can try enabling archiving via HTTP. Not a lot of traffic on this site. BTW - what would be "lot of traffic" in this case?

It depends a bit on your infrastructure/server config, but 50k pageviews per month is a good upper limit.

Are these the settings I want if I activate HTTP requests?

Yes, just the last setting in that image.

Saffronbunny commented 2 months ago

OK, I can see it's registering now. One more question - how can I filter out my own visits to the site?

diosmosis commented 2 months ago

@Saffronbunny you can exclude your own visits using the settings in the Matomo Analytics > Settings > Exclusions page.