Matomo (formerly Piwik) is a self-hosted website analytics solution positioned as an alternative to Google Analytics. If the idea of managing this solution yourself doesn't put you off, it comes with plenty of advantages and, what's more, stays fairly simple to install. Let's discover this solution together.

The problem with Google Analytics

Since the start of 2022, the CNIL has cracked down on the use of Google Analytics, which it considers non-compliant with the GDPR (the well-known European General Data Protection Regulation), and has issued formal notices to major web players requiring them to comply with European law.

At issue: the transfer of data and its processing outside European territory, namely to the United States, where there's no guarantee against the government accessing it in a way deemed arbitrary (search "Prism NSA" to understand why). Google, for its part, isn't exactly eager to keep this processing siloed within European territory.

While Google Analytics has become standard practice for many web marketing professionals, and many see its ban as a missed opportunity for the European industry, the fact remains that using this solution flirts with illegality and that it is increasingly less tolerated.

It's safe to bet that the CNIL will show less and less leniency going forward regarding poor GDPR compliance.

As respecting personal data becomes a selling point, the reflex of defaulting to Google Analytics is likely to be increasingly questioned going forward, which is a good reason from now on to take a look at its GDPR-friendly alternatives.

The benefits of using Matomo

Matomo is a self-hosted solution, meaning you run it on your own server.

This way, you keep control over the information collected, and you stay compliant with CNIL recommendations. It also exempts you, provided of course that you host your site within European territory and configure it correctly, from having to collect your visitors' consent.

Matomo works the same way as Google Analytics: so you shouldn't be too disoriented using it to track any kind of information: visits, events, conversions.

Less often mentioned about it, it's also a credible alternative to Google Tag Manager by letting you add tags directly to your site's pages.

And you'll have guessed it, the CNIL approves of and recommends using it in place of Google Analytics.

The cherry on top, it's compatible with Complianz, the plugin for managing your visitors' GDPR consent.

The different versions of Matomo and how to install them

Just like WordPress, Matomo is a PHP application that talks to a MySQL database. If you've already installed a WordPress site, installing Matomo shouldn't be a problem for you.

Server install "in 5 minutes"!

Matomo prides itself on a 5-minute install process, stopwatch in hand. It's the method I recommend.

The full procedure is detailed on Matomo's website: https://matomo.org/faq/on-premise/installing-matomo/

Do note that to run efficiently and securely, Matomo has some memory and database size requirements, which may be a bit steep for a typical shared hosting plan.

Don't forget to add the tracking code to your site's pages, the same way you're used to doing with GA.js. Naturally, avoid adding it through Google Tag Manager. If you're not familiar with adding this tracking code, I'll explain how to go about it later in the article!

Installing via WordPress

Matomo also offers an installation directly through its WordPress plugin. The install works like any WordPress plugin, it doesn't get simpler than that: through the plugin catalog or by uploading the archive to the plugins folder.

This plugin is official and maintained by the Matomo development team

The advantage here is that you don't have to worry about integrating the tracking code, the plugin handles all of that for you!

It's an interesting option if you want to move fast and not waste time on tons of configuration. You'll be more limited in how you use it, though, especially for managing several sites from the same interface.

Adding the tracking code to WordPress

Personally, I prefer to install Matomo the classic way (first method) on a neutral subdomain, which lets me allocate server resources solely for this application and avoid coupling my site's performance to that of my analytics tools.

With this method, I therefore need to add the tracking code to my WordPress site. I could handle it manually by adding it to my code. But I prefer to use the WP-Matomo Integration plugin.

Using it comes with several advantages :

  • Adding the tracking code becomes child's play
  • The plugin adds a tab in the CMS dashboard letting your team or your clients follow the analytics directly from the site's admin interface
  • It's not developed directly by the Matomo team, but it's recommended in the official documentation

Conclusion

You now have GDPR-compliant analytics and don't risk being bothered by the CNIL.

Don't rest on your laurels!

Careful, simply using Matomo doesn't mean you're complying with every CNIL recommendation to the letter: on top of that, you'll need to make sure not to enable certain options that go against these guidelines, and pay attention to other parts of your site that might collect customer data, such as your forms for example.

Going further with Matomo

If you want to take your use of Matomo further, you can now:

  • Integrate Matomo with Complianz
  • Configure Matomo's integration with Swup.js or TurboLink
  • Discover Matomo's premium plugins

Need help installing Matomo?

Feel free to ask for help from a Senior Developer to assist you with installing and configuring Matomo.