How do I let visitors opt-out from tracking?
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 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.
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:
- Click the cog icon within the top menu to go to the Matomo settings page.
- Click Users opt-out menu item within the Privacy section of the main navigation on the left-hand side.
- The form settings are shown within a section called Let users opt-out of tracking.
- 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. - 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.
- 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:
- Login to your WordPress dashboard.
- Click to Add New or Edit all pages where you would like the form to appear.
- Paste in the following shortcode:
[matomo_opt_out] - 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.
- Click the cog icon within the top menu to load the Matomo settings page.
- Click Users opt-out menu item within the Privacy section of the main navigation on the left-hand side.
- Scroll down to the Support Do Not Track preference section.
- Click Enable Do Not Track support (Recommended) so a green bullet is shown.
- Click the big green Save button.