@tsteur opened this Pull Request on July 6th 2020 Member

refs https://github.com/matomo-org/matomo/issues/15948

Works the same way as tracking consent. However, you need to change Consent to CookieConsent:

  • _paq.push(['requireConsent']); --> _paq.push(['requireCookieConsent']);
  • _paq.push(['setConsentGiven']); --> _paq.push(['setCookieConsentGiven']);
  • _paq.push(['rememberConsentGiven']); --> _paq.push(['rememberCookieConsentGiven']);
  • _paq.push(['forgetConsentGiven']); --> _paq.push(['forgetCookieConsentGiven']);

Renamed enableCookies for consistency to setCookieConsentGiven. The method was only added last week so that's not an issue.

disableCookies still exists and won't change meaning it will always disable cookies no matter if consent was given or not.

Basically it works the very same way as regular consent see https://developer.matomo.org/guides/tracking-javascript-guide#asking-for-consent

Eg you add _paq.push(['requireCookieConsent']); to your tracking code and it will keep on tracking but won't set any cookies.

Unless you call either _paq.push(['setCookieConsentGiven']) on every page view or once _paq.push(['rememberCookieConsentGiven']); to store the consent in a cookie.

Once consent was revoked, you can call _paq.push(['forgetCookieConsentGiven']); to remove the existing cookie.

documentation in https://github.com/matomo-org/developer-documentation/pull/359/files

Failing tests aren't related to this PR

@tsteur commented on July 6th 2020 Member

build js

@tsteur commented on July 6th 2020 Member

fyi @Findus23

This Pull Request was closed on July 7th 2020
Powered by GitHub Issue Mirror