Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't create test cookies when cookies are disabled #17892

Closed
tsteur opened this issue Aug 16, 2021 · 0 comments · Fixed by #18935
Closed

Don't create test cookies when cookies are disabled #17892

tsteur opened this issue Aug 16, 2021 · 0 comments · Fixed by #18935
Assignees
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

Comments

@tsteur
Copy link
Member

tsteur commented Aug 16, 2021

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 in

function setVisitorIdCookie(visitorIdCookieValues) {
which is then deleted again.

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.trigger('TrackerSetup', [this]);
after triggering the 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

@tsteur tsteur added Bug For errors / faults / flaws / inconsistencies etc. Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Aug 16, 2021
@tsteur tsteur added this to the 4.5.0 milestone Aug 16, 2021
@tsteur tsteur added the c: Privacy For issues that impact or improve the privacy. label Aug 16, 2021
@justinvelluppillai justinvelluppillai self-assigned this Aug 30, 2021
@justinvelluppillai justinvelluppillai modified the milestones: 4.5.0, 4.6.0 Oct 7, 2021
@sgiehl sgiehl modified the milestones: 4.6.0, 4.7.0 Nov 18, 2021
@justinvelluppillai justinvelluppillai modified the milestones: 4.7.0, 4.8.0 Jan 18, 2022
@justinvelluppillai justinvelluppillai modified the milestones: 4.8.0, 4.9.0 Mar 1, 2022
@justinvelluppillai justinvelluppillai changed the title Cookie created even though cookies are disabled Don't create test cookies when cookies are disabled Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
3 participants