How to Add Matomo to Your Website

In Matomo, go to Administration, then Websites, then Tracking Code, select your site and copy the JavaScript. Paste it before the closing head tag on every page. Matomo comes as Matomo Cloud, with a 21-day free trial, or as free software you host on your own server.

Cloud or self-hosted
Matomo CloudMatomo On-Premise
Who runs the serverMatomoYou
CostPaid plans after a 21-day trialSoftware is free; you pay for hosting
Data locationMatomo's hostingWherever your server is
WordPress optionConnect Matomo pluginMatomo inside WordPress, or connect

Updated

Matomo is the open-source analytics suite that public bodies and privacy-minded companies pick when they want Google Analytics-style reports while keeping full ownership of the data. The trade-off with self-hosting is that updates and backups are now your job.

Add Matomo on We.Inc, WordPress, Wix, Squarespace or plain HTML

We.Inc

  1. Go to Add-ons through the "..." menu.
  2. Open Matomo Cloud and fill in your Matomo address and site ID.
  3. Switch it on.
  4. Publish, then watch Visits in real-time in Matomo.

The add-on is built for Matomo Cloud. For a self-hosted Matomo, ask the AI chat to add your tracking code instead (credits, paid plan).

WordPress

  1. Go to Plugins, Add Plugin.
  2. For Matomo inside WordPress, install Matomo Analytics, Ethical Stats; to link an existing Matomo, install Connect Matomo.
  3. Activate it and follow its setup screen.

WordPress.com needs a paid plan for plugins.

Wix

  1. Go to Settings, Custom Code, + Add Custom Code.
  2. Paste the Matomo snippet, choose All pages and Head, and apply.

Custom code requires a published Wix site on your own connected domain.

Squarespace

  1. Open the Code Injection panel.
  2. Paste the tracking code into Header and save.

Code Injection: Core, Plus and Advanced plans.

Plain HTML

  1. Paste the code just before </head> on every page.
  2. Add the disableCookies line first if you want cookieless tracking.
  3. Deploy and check real-time visits.

Turning off Matomo cookies

This line goes inside Matomo's snippet, above the trackPageView line that is already there.

_paq.push(['disableCookies']);
_paq.push(['trackPageView']);

Sources

  • Matomo FAQ, install the tracking code on an HTML website: https://matomo.org/faq/how-do-i-install-the-matomo-analytics-tracking-code-on-an-html-website/ (checked October 28, 2026, used for the Matomo steps)
  • Matomo FAQ, tracking without cookies: https://matomo.org/faq/general/faq_157/ (checked October 28, 2026, used for the Matomo steps)
  • Matomo FAQ, the Matomo Cloud 21-day free trial: https://matomo.org/faq/cloud/whats-included-in-the-matomo-cloud-21-day-free-trial/ (checked October 28, 2026, used for the Matomo steps)
  • WordPress.org, Matomo Analytics plugin: https://wordpress.org/plugins/matomo/ (checked October 28, 2026, used for the Matomo steps)
  • Wix Help Center, embedding custom code: https://support.wix.com/en/article/embedding-custom-code-on-your-site (checked October 28, 2026, used for the Matomo steps)
  • Squarespace Help Center, using code injection: https://support.squarespace.com/hc/en-us/articles/205815908-Using-code-injection (checked October 28, 2026, used for the Matomo steps)

Cookies and consent

By default Matomo sets first-party cookies to recognise returning visitors. Adding _paq.push(['disableCookies']) before the pageview call turns them off, at some cost to returning-visitor accuracy.

Matomo notes that some European regulators accept cookieless setups without prior consent under strict conditions. That is a legal judgement for your country; if unsure, ask first through a banner (/guides/how-to-add-cookie-banner-to-website).

How it works

  1. Set up Matomo Cloud or install Matomo on your server, and add your website.
  2. Open Administration, Websites, Tracking Code and copy the snippet.
  3. Paste it before </head> on each page.
  4. Check the Visits in real-time widget, or filter the Network tab for matomo.php.

Tips

  • If you use Matomo Tag Manager, copy the container code from Install Code instead of the plain tracking code.
  • Track form success pages as goals in Matomo so conversions show in the default reports.
  • Self-hosting? Put Matomo on its own subdomain so the tracker loads from your domain.

Frequently asked questions

Is Matomo free?

The On-Premise software is free and open source; you pay only for the server. Matomo Cloud is a paid service with a 21-day free trial.

Which WordPress plugin should I use?

Matomo Analytics, Ethical Stats installs Matomo inside WordPress itself. If you already run Matomo Cloud or your own server, Matomo says to use the Connect Matomo plugin instead.

Where should the Matomo code go, head or body?

Matomo's install guide says the head, just before the closing </head> tag.

Related: How to add Plausible Analytics, How to set up Google Analytics, How to add a cookie banner, Terms of service vs privacy policy.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap