Important note: Depending on privacy laws that apply to your website (e.g., GDPR/ePrivacy) you may be required to track only with consent (opt-in). If you want to or are required by applicable privacy laws to obtain user consent before tracking, you will need to ask for consent by following the steps in Implementing tracking consent in Matomo before any tracking commences. The opt-out function should be used only when opt-in is not required or consent exemption applies.

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 in Matomo’s Privacy Settings.

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 on Administration matomo admin gear icon in the top menu.
  2. Go to the Privacy menu and open the Users opt-out menu item.
    Matomo User opt-out menu
  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.

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

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 support for the Do Not Track header has been deprecated. As more browsers have either started automatically sending this header without giving users the option to change it or have completely discontinued support for it, we no longer recommend enabling this option. This feature may be completely removed in one of the upcoming major releases.

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 on Administration matomo admin gear icon in the top menu.
  2. Go to the Privacy menu and open the Users opt-out menu item.
  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 Save button.

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

Previous FAQ: How do I enforce tracking without cookies