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 set any cookies when no consent is given #16173

Merged
merged 30 commits into from Jul 5, 2020
Merged

Don't set any cookies when no consent is given #16173

merged 30 commits into from Jul 5, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jul 3, 2020

fix #13246

this PR is based on https://github.com/matomo-org/matomo/pull/16113/files and should be reviewed and merged soon. The change is this PR is a lot smaller.

This applies when someone calls requireConsent. In the past we would have still set a visitor cookie even though if no further call to eg setConsentGiven or rememberConsentGiven followed.

In the past, the visitorId cookie was set when calling setSiteId. I'm not sure why this was the case but it shouldn't be needed to set it so early in the configuration process of a new tracker. In fact we're setting the session and attribution cookie already only when calling getRequest('...') (eg getRequest('action_name=foo')) so it should be fine to set the visitor cookie also only once getRequest is being called which this PR now does.

It does change the nowTs which is stored in the visitor cookie but that shouldn't really change anything cause mostly a tracking request follows directly anyway. And if in past there were cookies disabled etc then we wouldn't have been able to set this anyway.

It's adding a new tracker method areCookiesEnabled but not adding it to the changelog as it doesn't actually do anything and you can't really use it with _paq.push but will document it once merged.

@tsteur tsteur added this to the 3.13.7 milestone Jul 3, 2020
@tsteur
Copy link
Member Author

tsteur commented Jul 3, 2020

build js

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jul 3, 2020
@tsteur
Copy link
Member Author

tsteur commented Jul 3, 2020

build js

*
* It will also automatically enable cookies if they were disabled previously.
*
* @param bool [enableCookies=true] Internal parameter. Defines whether cookies should be enabled or not.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could generally expose this parameter as a support official parameter. However, then we'd also need to add this to rememberConsentGiven () method and the problem is that we'd then need to persist in yet another cookie whether rememberConsentGiven () should always enable cookies or not. Easier to consider it an internal parameter for now

@diosmosis diosmosis merged commit 3a63670 into 3.x-dev Jul 5, 2020
@diosmosis diosmosis deleted the 13246 branch July 5, 2020 21:25
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
* Better detection for cookies for browser plugins report

* rebuilt piwik.js

* improve comment

* Add method to enable cookies

* rebuilt piwik.js

* fix test

* no longer include cookie in fingerprint

* only ignore cookies in fingerprint for IE

* fix tests

* fix test

* tweak enablecookies

* rebuilt piwik.js

* send tracking request if needed when enable cookies

* rebuilt piwik.js

* tweak code

* update docs

* rebuilt piwik.js

* Update Visit.php

* fix tests

* Don't set cookies unless consent given when consent is required

* fix test

* rebuilt piwik.js

* add tests

* add missing function

* rebuilt piwik.js

* fix jslint test
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
* Better detection for cookies for browser plugins report

* rebuilt piwik.js

* improve comment

* Add method to enable cookies

* rebuilt piwik.js

* fix test

* no longer include cookie in fingerprint

* only ignore cookies in fingerprint for IE

* fix tests

* fix test

* tweak enablecookies

* rebuilt piwik.js

* send tracking request if needed when enable cookies

* rebuilt piwik.js

* tweak code

* update docs

* rebuilt piwik.js

* Update Visit.php

* fix tests

* Don't set cookies unless consent given when consent is required

* fix test

* rebuilt piwik.js

* add tests

* add missing function

* rebuilt piwik.js

* fix jslint test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants