Matomo statistics
Matomo statistics
What Matomo is, and how to add it to your site by pasting its tracking code.
What Matomo is
Matomo is a free, open-source statistics tool, an alternative to Google Analytics. It shows how many people visit your site, which pages they read, where they came from and which country they are in.
The difference is where the data lives. Matomo runs on your own hosting, so your visitors' data stays with you and is not shared with an advertising company. Many hosting control panels can install it for you in a few clicks, usually on its own subdomain such as stats.yoursite.com. Matomo also offers a paid hosted version if you would rather not run it yourself.
Connect it to your site
Matomo gives you a short piece of tracking code for your website. The theme adds it to every page for you: you paste it once, under Design ▸ Custom code.
- Install Matomo on your hosting (or sign up for Matomo's hosted version) and add your website in Matomo.
- In Matomo, open the tracking code for your website. In most versions it is under Administration ▸ Websites ▸ Tracking code.
- Copy the code. It starts with
<!-- Matomo -->and ends with<!-- End Matomo Code -->. - In your WordPress admin, open Design ▸ Custom code and choose JS.
- Paste only the lines between
<script>and</script>. Leave out the two<script>tags themselves and the two<!-- -->comment lines: the theme adds the script tags for you. - Click Save changes.
The code then runs on every page of your site, but never in your admin area. Visit a few pages, then check Matomo: your visits should appear within a few minutes.
Only administrators who are allowed to add code to the site can save this box.
Cookies and consent
Depending on where you and your visitors are, privacy rules may require you to ask before you store cookies on a visitor's device.
- Matomo can count visits without cookies. In many countries that means you do not need to ask for consent just for statistics. When you copy the tracking code in Matomo, tick the option to disable all tracking cookies first, so the code you paste already includes it.
- If you do use cookies, show a cookie notice. The theme has one: open Users ▸ Consent popups and switch on GDPR consent.
If you are not sure what applies to your site, check the guidance from your country's data protection authority.