April 16, 2018, 2:39pm
We use Matomo on our server for a number of websites, all running on the same web server. Our problem with the opt-out cookie is that it does not seem to be site-specific. So if a user chooses not to be tracked on one of them we will lose them on all websites. Is there a way to include the website URL or Matomo site ID in the opt-out code?
Same thing here, would like to know how to opt-out from just a particular site, not all on server…
April 25, 2018, 2:59pm
This is currently by design.
But there are ideas that may change this.
01:21AM - 24 Apr 18 UTC
08:08PM - 03 Sep 20 UTC
Currently, when a user [opts-out of tracking](https://matomo.org/docs/privacy/#s
… tep-3-include-a-web-analytics-opt-out-feature-on-your-site-using-an-iframe), the requests will be ignored by the Tracking API, but the requests are still sent anyway. For better privacy, we should try not to send the requests at all, after a user has opted out.
This was discussed in https://github.com/matomo-org/matomo/issues/12598#issuecomment-376413660:
> Unfortunately because the opt-out cookie is third party, it is not really possible to read it in JS and therefore not send the tracking requests... I'm not sure how we could handle this problem.
> There could be couple of things but didn't think too much about it...
> * If the site that embeds the opt out iframe also embeds the JS tracker, then they could potentially communicate with each other eg using messages or by listening to URL changes on the iframe. This would not be supported in older browsers though and might depend on the security policy set for the website... https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
> * We could also offer eventually users an upgrade to the opt-out iframe and rather give them some HTML to copy/paste to not having to use an iframe and it would let Matomo users allow the advantage that they wouldn't be opt out on all websites that Matomo hosts but only an individual website
> * Also directly in piwik.php we should directly check for an opt out cookie and if present stop the request as early as possible to make sure this is respected to avoid problems like there were with QueuedTracking etc and to make sure no data is being processed.
>There are also tools like https://github.com/contently/xdomain-cookies but they insert eg an iframe into the page to read cookies cross domain in which a request would be sent again which defeats the purpose...
> it would let Matomo users allow the advantage that they wouldn't be opt out on all websites that Matomo hosts but only an individual website
it is also a big strength that we do opt-out across all websites on the Matomo instance at once, so would be great to keep this functionality.
April 25, 2018, 3:14pm
This morning I received a reply to a support request I had sent earlier via email. Matthieu Aubry from Matomo wrote this:
“Correct. Currently, there is no other way to opt-out than on all websites.
We may improve this in the future.”