Matomo is one of the leading alternatives to Google Analytics. But how does Matomo perform? Can using this tool slow down your site?
We ran tests on the different versions of Matomo to see what happens. Let’s check out our analysis.
But, first, let’s go over a brief overview of the versions of Matomo and why to use it.
Table of Contents
As of lately, Google Analytics has come under the spotlight because it is not deemed “GDPR-compliant”. We covered this issue extensively in an interview with Frida Del Din on the case GDPR and Google Analytics.
In short, when using a Google Tool, your data is transferred to the United States.This prompted many website managers to look for alternatives. Matomo is definitely among the top choices when it comes to finding a GDPR-compliant Analytics system. In this case, in fact, all data is stored on the same server on which the website is hosted.
To be precise, however, there are several possible solutions.
Let’s take a look at them.
Versions of Matomo
Matomo is the alternative to Google Analytics that allows us to collect data and statistics and store this data in accordance with the GDPR.
There are several versions of Matomo:
- Matomo Cloud
- Matomo On-Premise
- Matomo for WordPress.
Matomo Cloud is a paid version of the tool. It is not a self-hosted version, but one relies on Matomo's servers and, specifically, a datacenter in Germany.
Data, therefore, are stored on servers in Europe and there is no transfer of data to countries outside the European Union without consent. The Cloud version of Matomo has a monthly cost starting at €19. This cost may also increase as incoming traffic to the site increases.
If we consider that in one year you are going to spend 228€, we are talking about much higher figures than hosting and domain costs. Our shared hosting plans start from 34€ per year.
Matomo On-Premise is the free version of the tool. This version has the feature, as we said before, that it can be installed directly on your own server.
Specifically, as we saw in our guide on how to install Matomo, we simply install the tool on a subdomain or subfolder.
If we then want to transfer the data collected with the Google tool, we can Import data from Google Analytics to Matomo, as I explain in another guide.
Matomo with a ready-made solution
If you are having difficulty with installation and don't want to or can't take care of it yourself, you can take a look at our service Matomo Analytics.
For the nominal price of 1€ per year, we offer, Matomo out of the box. You don't need to install, configure or update anything. Activate the service and add the tracking code and you're all set.
Matomo for WordPress
If you have a WordPress site, you can directly install and activate the Matomo plugin like any other WordPress plugins.
After activating the plugin you can enable tracking by simply clicking a button.
Does Matomo slow down the site? Is it true that it affects performance?
When analyzing a client's site, I noticed a long request that was too long, in the waterfall.
I am familiar with wp-ajax requests, and they are always requests that slow down the site, even if in defer, when you look at the load time on GTmetrix.
Let us see for a moment how Matomo works.
We insert a script in the footer of our website, the same way we have always done with Google Analytics.
Even if we use the WordPress plugin the script is inserted in the footer, only the call is slightly different, as we will see in a moment.
The script waits until the page has finished loading, then sends a POST request to Matomo. This request as we will see in a moment takes some time, from a few milliseconds to a few seconds in some cases.
At this point the user already sees the page, so from a browsing experience point of view it is not a real problem.
This POST request, however, goes to affect the loading time of our website. From my testing, it does not appear that Google PageSpeed parameters are affected.
This request is obviously necessary, to let Matomo know that a page has been visited, for example the request in the screenshot above has these parameters:
But why does such a request take a second?
Or maybe I should ask a different question....
Why does the request to Matomo last 5.4 seconds?
It would be faster to send the request with a smoke signal.
This doesn't make sense, which is why I decided to investigate it.
I did additional tests, such as this one:
And like this:
Matomo completes the request in 245ms, 2.5 tenths of a second
Granted that 191ms and 245 ms are still more than the 44ms of Google Tag Manager that you see in the last screenshot, these are all in all acceptable times, we are talking about 2 tenths of a second, not a few seconds.
And still they are actions that are performed after the page has finished loading and the user can interact with our page.
So Matomo does not always slow down a site.
But if it doesn't always slow down, when does it actually slow down? When does it make sense to call Matomo slow?
I'll let you in on a secret.
The screenshot showing that Matomo loads in 191 ms is with the WordPress plugin version. The other, the one from the SupportHost site that takes 245 ms, on the other hand uses Matomo On-Premise installed on a subdomain.
So, it's not the WordPress plugin that slows down compared to the On-Premise version? Or is it? Let's analyze further.
Matomo On-Premise vs Matomo for WordPress
In fact, Matomo's version for WordPress slows down the site.
Then why did using the WordPress plugin load in 191ms, while on other installations it loaded in over a second?
The developers of the plugin explain it to us Matomo for WordPress:
The solution would be indeed to use Matomo On-Premise. The same speed in the plugin is not reachable because we always have to bootstrap the entire WordPress and for example depending on amount of plugins this can take a bit of time.@mattmary
Basically when we call the file:
the plugin needs to call the entire WordPress framework and this, depending on the number of plugins you use, can take some time.
In another response we read:
thanks for the tips for performance improvements. It works that way since Matomo for WordPress is mostly intended for small websites with less traffic and performance is usually not super critical. Since there is an alternative with Matomo On-Premise already there we don’t go through the effort to also optimise Matomo for WordPress for ultimate performance. This of course can change in the future. Generally, by not optimising it helps us having it work on all WordPress installations out of the box without any issues. As you know WordPress powers most website and runs on millions of differently configured servers and installations and by bootstrapping WordPress every time we can ensure that things work without issues.@tsteur
In practice, the plugin will not be improved due to compatibility issues, and if we want to get a better performance, it is better to use Matomo On-Premise.
I should add a note here: the site for which Matomo loaded in 5.4 seconds is hosted on Aruba.
So now it becomes clear why using Matomo On-Premise or our version of Matomo Analytics makes sense from a performance point of view. While the WordPress plugin version is to be avoided in my opinion, if you want to have a fast site and if we want to avoid using plugins that slow down WordPress.
In the test where I show that the WordPress plugin finishes the Matomo request in 191ms, it is a newly installed site with no plugins. In that case, while having to load the whole WordPress structure the problem does not arise since there are no plugins installed and therefore WordPress is still very light.
On a real site the numbers are quite different, I invite you to try it and let me know in the comments section.
I installed Matomo on WordPress but didn't notice any slowdowns
While checking the various sites I got this kind of comment:
Although I did not have a chance to see that specific site in detail, I checked others that had similar characteristics.
One might wonder why some sites are slowed down while others are not? The problem then does not depend on slow Matomo, but on what other reason?
The solution in this case lies in another plugin: the plugin used for cookies.
If set up the cookie plugin correctly, it should block the Matomo script if the user does not accept cookies.
On some of the sites analyzed, I noticed this code:
<script type="text/plain" data-service="matomo" data-category="statistics">
Adding the type "text/plain" to a script is used to indicate to the browser that it should not execute the script, but should precisely treat it as normal text.
So until the analytical cookies are accepted the Matomo script is not executed, we do not notice any slowdown and in the waterfall and we do not see any calls to Matomo.
Once we accept the cookies, however, the call to Matomo starts, because the cookie plugin changes the type to:
In this case keep in mind that the visits you see on Matomo are not the actual visits, but are the visits of those users who have decided to accept your analytical cookies.
Configure Matomo to be faster
How do you improve Matomo's performance?
There are several tricks that can help us.
Disable real-time reports
By default, Matomo generates reports in real time.
The first thing to do, then, when you are using the tool on a large site is to change the frequency of reports and turn off the real-time ones.
To do this we simply set a cron job (for example, from cPanel) so that reports are generated at set intervals, for example, every 1 or 6 hours.
Take a look at the FAQ if you want to read the procedure in detail.
Update Matomo to the latest version
It is important to keep Matomo updated to the latest version.
In fact, when a new update is released, changes may be made to the SQL schema, i.e., the structure of the database.
These changes are also introduced to improve the performance of Matomo.
Ideal server configuration
To prevent Matomo from slowing down the site, certain requirements are recommended.
RAM: the recommended minimum is 1GB.
PHP version: we recommend PHP7 and to use the latest stable version. With SupportHost you can change the PHP version independently and use the latest available.
Database: estimated usage is 1GB per 5 million page views. If you have space limitations, you will need to delete older logs from time to time. If you choose SupportHost you can count on an optimized MySQL database to improve performance.
It is also recommended to use SSD disks, precisely because the SSD hosting has advantages in speed and performance. All our servers use NVMe SSD disks to ensure optimal performance at all times.
Which version should you use for Matomo? How do you avoid the problem of slow Matomo?
First of all, I would ask another question: does it make sense to use an Analytics system?
If your business does not depend on Analytics for campaign tracking, perhaps it makes sense to eliminate everything.
If we are going to use Analytics as vanity metrics, we might as well look at AWStat in cPanel, with the advantage of reading real data, and not just seeing the visits of those users who have decided to accept our analytic cookies.
If your strategy depends on (real) use of an Analytics tool avoid using the WordPress plugin, try to use a version that does not worsen the performance of your website.
Did you find my article useful? Do you have verified data that confirm or oppose my thesis? Let me know in the comments below.