With any new Matomo installation, you may have a few system issues that arise. Don’t worry they are easy to fix, and this post should show you all the modifications you need to make.
You can check for issues by clicking the gear icon on the right side of the top bar;
Last Successful Archiving Completion:
Setting your archiving to run as a Cron job is much better than making it run every time you want to load the analytics. This ensures that the task is already completed when you request the data to be loaded.
Set the Cron job to run every hour, and adjust the command below to include your Matomo domain and the correct authentication token.
wget -O - "https://analytics.mstd.me/misc/cron/archive.php?token_auth=your_auth_token" >/dev/null 2>&1
Your authentication token should be in the settings menu under – Personal > Settings – at the bottom of the page;
Once you have set up the Cron job, go into the settings menu under – System > General settings – and change the archiving settings to no just like the image above. Then save your changes;
Max Packet Size:
Changing the max_allowed_packet size is just a matter of editing the MySQL configuration file; You can do so with the command below, so open your terminal and SSH into your server.
sudo nano /etc/mysql/my.cnf
Now change the entry for max_allowed_packet from 16MB to 64MB; Save and exit out of the file by pressing “Ctrl + O” and then “Enter” to save followed by “Ctrl + X” to exit out of the file. Now restart your MySQL service to apply the changes to the config file.
sudo systemctl restart mysql
The issue should be resolved by now.
Forced SSL Connection:
Using HTTP alone is always discouraged as information that is passed through your server is not passed in a secure and encrypted way. That is why we must only use SSL with our HTTP protocol, we should force the browser to only transfer data over SSL.
Move to the directory of your Matomo installation inside the SSH session of your terminal; Then edit the config file and add the following line.
sudo nano config/config.ini.php
Under the General tab add the following line after the trusted hosts entry; Save and exit out of the file by pressing “Ctrl + O” and then “Enter” to save followed by “Ctrl + X” to exit out of the file.
The Maxmind cities database has a much more accurate and up to date IP address database to help reference the location of your visitors. Go into the settings menu under – System > Geolocation – scroll down to the bottom of the page and click on “Get started” to automatically download the database.
Then move the location provider option to “GeoIP 2 (PHP)” from the Default option and save your changes;
That’s all the changes you should make to your system; congratulations your Matomo installation is configured properly and there shouldn’t be any issues left.