Don't create test cookies when cookies are disabled #17892
Labels
Bug
For errors / faults / flaws / inconsistencies etc.
c: Privacy
For issues that impact or improve the privacy.
Regression
Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone
refs https://forum.matomo.org/t/force-tracking-without-cookies-and-disable-cookies-not-working/42563/10
refs matomo-org/tag-manager#158
When having cookies disabled in the Matomo configuration variable, and even when in privacy anonoymisation settings cookies are force disabled, then Matomo JS tracker will still create a cookie and then delete it again right away.
This is because
setVisitorCookie
is called in https://github.com/matomo-org/matomo/blob/4.4.1/js/piwik.js#L4830 before any other plugins etc can disable it.And because tag manager does
new Tracker(url, idsite)
it already has the idsite at time of tracker instance creation and therefore it does set a cookie inmatomo/js/piwik.js
Line 3341 in f57a531
The problem is when clicking eg in Chrome on the SSL certificate and then Cookies then this cookie still appears there and it looks to visitors as if cookies were used.
There used to be this fix for it in Tag Manager: matomo-org/tag-manager#158
We then believed this temporary workaround was no longer needed as not having the idSite in constructor can cause other side effects. It looks like it is still an issue though. In matomo-org/tag-manager#261 we changed it back and thought it was working now but it isn't.
Maybe a workaround to fix this issue could be to call the visitor cookie method around here
matomo/js/piwik.js
Line 6938 in f57a531
TrackerSetup
event.To reproduce this create a new tracker instance where you create a URL and idSite.
we should comment in https://forum.matomo.org/t/force-tracking-without-cookies-and-disable-cookies-not-working/42563/12 once fixed
The text was updated successfully, but these errors were encountered: