disableCookies, Opt-Out and disabled tracking by browser

Good evening,

I have some questions regarding cookies and tracking.
As I understood, a user is still tracked when I use disableCookies(), just not as a unique visitor because no cookie to identify this visitor is set.

So if I don’t want the visitor to be tracked, the opt-out-cookie via the iframe has to be set.

My questions are:

  • Is there a way to set the opt-out-cookie by default and create thereby an opt-in-solution?
  • how is the disableCookie- and opt-out-cookie influenced if tracking is disabled by the browser? Does this affect these cookies also?

Thank you very much for the information and help in advance.

Kind regards


See JavaScript Tracking Client: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3 (or the “Asking for Consent” page in Matomo) for an explanation on how to implement an opt-in tracking.

That depends on what you mean by disabled by the browser. If you are referring to DoNotTrack:

If you only have configured DNT in Matomo, then all data is still tracked (including cookies), but Matomo drops them when it recieves it.
If you add _paq.push(['setDoNotTrack', true]); to the tracking code, no data should be sent and (I think) also no cookie is set. But I haven’t tested the latter.

Thank you so much for the clarification!

Regarding the browser setting, I was thinking of disabling third party cookies. Does this also affect cookies that prohibit tracking and sending of data?