In some countries, the law requests websites to provide a way for users to opt-out of all tracking, in particular tracking cookies.
Disable cookies for all sites within Matomo
Disable cookies for a specific site when you are using Matomo On-Premise or Matomo Cloud
See also: List of cookies used by Matomo (Piwik).
[...] // Call disableCookies before calling trackPageView _paq.push(['disableCookies']); _paq.push(['trackPageView']); [...]
If you are using Matomo for WordPress
Log in to your WordPress Admin Dashboard. Go to “Matomo Analytics -> Settings”. You will see the tracking settings page. To disable cookies enable the option “Disable cookies” and press “Save changes”.
If you are using Matomo Tag Manager
Using Matomo Tag Manager, you can disable tracking cookies by either of these solutions:
- in your Matomo Tag, you can check the option “Disable cookies” which will disable all first party tracking cookies for Matomo.
_paq.push(['requireCookieConsent']);in this tag. You would also need to create a Trigger on “DOM Ready” (which will be executed first before the Pageview trigger). Then in your Custom HTML tag, set “Execute this tag when any of these triggers are triggered.” to “DOM Ready”.
Implications on data accuracy
Learn more how cookie affect data accuracy in our FAQ: When cookies are disabled by a visitor, how does it impact Matomo reports accuracy?
Implication on cookie consent banner and asking user for consent
Essential non-analytics cookies that may still be created
Note: when cookies are disabled, there may still be a few essential cookies created in specific cases:
- when you exclude yourself from being tracked using the cookie method or using the iframe opt-out method, Matomo will create a cookie
piwik_ignoreset on the domain of your Matomo server (a temporary short-lived cookie called
MATOMO_SESSIDwill also be created).
- when you’re asking for consent before tracking visitors, two cookies may be created:
_pk_testcookieis also created without any identifier and is directly deleted (it is only used to check whether the visitor’s browser supports cookies)