To respect the privacy of your visitors, there are two primary mechanisms built into Matomo which allow a user to opt-out of tracking. You can configure both opt-out mechanisms within the Matomo privacy settings section, which can be accessed by clicking the cog icon Settings Cog Icon in the top menu. This loads the Settings page where you need to click on the Users opt-out menu item within the Privacy section.

Matomo User opt-out menu

It is also possible to create custom opt-out forms by following the developer documentation. Alternatively, if you want to opt-out all your users by default instead and let them opt-in to being tracked, then you can “require consent” and ask for consent by following the steps in Implementing tracking consent in Matomo

Customise and publish the Matomo opt-out form HTML

The Matomo Opt-out form is a short HTML code snippet you can place on pages of your website, such as your privacy policy, so people can exclude themselves from being tracked. It works by setting a cookie that contains no personal data and tells Matomo that it should not collect any data about this user.

Matomo offers a simple interface to customise the appearance of this form so it is consistent with the design of other content on your site. To match your website design, you will need to know the font family, font size, and content colours from your site. If you aren’t sure, you may need to ask a web designer about these. To get started, follow the steps below:

  1. Click the cog icon Settings Cog Icon within the top menu to go to the Matomo settings page.
  2. Click Users opt-out menu item within the Privacy section of the main navigation on the left-hand side.
  3. The form settings are shown within a section called Let users opt-out of tracking.
    Matomo User Opt-out Settings
  4. Enter the font and colour details of your website into the Customize the Opt-out iframe section. You should see a preview of what will be shown at the bottom of this section.
    Note: The colour picker works differently depending on the browser and operating system you use. Learn more about available customisations here.
  5. Once you are happy that the preview looks similar to the style of the content on the page that you will add it to, copy the HTML code from the dark box above the preview.
  6. Paste the HTML code directly into your web pages HTML at the place within your content where it should appear. If you aren’t comfortable accessing your website code, you may need to consult a web developer to assist with this.

Publishing the opt-out form in Matomo for WordPress

Adding the Matomo Opt-out form is even easier if you are using Matomo for WordPress. The form is designed to automatically use the style of the page you publish it on. Therefore to publish the form on a WordPress site follow these simple steps:

  1. Login to your WordPress dashboard.
  2. Click to Add New or Edit all pages where you would like the form to appear.
  3. Paste in the following shortcode:
    [matomo_opt_out]
  4. Click the blue Publish or Update button at the top of the page.

How to Enable Do Not Track within Matomo

The Do Not Track preference is an additional way users can tell all websites they would prefer not to be tracked. It is a setting that users configure within their browsers. However, as it has not received widespread adoption and is simply ignored by many advertisers, lots of tools and websites simply ignore this setting. As a good web citizen, Matomo offers you the ability to support this feature for anyone that has the setting enabled.

  1. Click the cog icon Settings Cog Icon within the top menu to load the Matomo settings page.
  2. Click Users opt-out menu item within the Privacy section of the main navigation on the left-hand side.
  3. Scroll down to the Support Do Not Track preference section.
  4. Click Enable Do Not Track support (Recommended) so a green bullet is shown.
    Do Not Track Support Toggle
  5. Click the big green Save button.

See also: How do I exclude / ignore my traffic from Matomo?

Previous FAQ: How do I enforce tracking without cookies