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

Feature request: improve documentation on reading user consent state #17169

Open
unikitty37 opened this issue Jan 30, 2021 · 1 comment
Open
Labels
c: APIs For bugs and features in the Matomo HTTP and plugin APIs. c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. c: Privacy For issues that impact or improve the privacy. c: Tracking For issues related to getting tracking data into Matomo. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@unikitty37
Copy link

The guide at https://developer.matomo.org/guides/tracking-consent shows how to set and forget the user consent settings, but step 2 (asking for consent through your privacy notice) doesn't go into much detail on how to read the consent settings; the linked article in that section is more about the wording of the notice than implementation details.

Specifically, if we imagine the user's consent as having three states: granted, denied, or undefined (the default state), and we only want to display the privacy notice if it is set to undefined, the documentation is very light on details there.

I assume some combination of hasRememberedConsent() and getRememberedConsent() will do the trick, but it's not really clear how to get from that to "user has definitely given consent", "user has definitely refused consent", or "user has not answered either way".

It doesn't help that typing either of those function names into the documentation search box returns no results — the only thing about consent is the page at https://developer.matomo.org/guides/tracking-consent which doesn't document the specific calls in any great detail.

Specifically, it does not find https://developer.matomo.org/api-reference/tracking-javascript#managing-consent, which gives a bit more detail, but is still unclear on how to tell the difference between "user refused consent" and "user has not answered the question yet".

(If the documentation already exists, it's a bit pointless if the search can't find it 😁 )

The documentation should really make it clear how to tell the difference so developers under time pressure don't simply implement it as "if user has not consented, display the consent dialog until they do", which is not the sort of behaviour that should be encouraged…

Ideally, getRememberedConsent() would return the time the question was answered, regardless of whether consent was granted or denied, so a truthy value would indicate the question has been answered. But that would probably be a breaking change now.

By the way, I did look at https://developer.matomo.org/guides/core-team-workflow#submitting-a-feature-request per the contributing guidelines, but many of the links in there point to piwik.org and are now dead…

@tsteur tsteur added the c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. label Feb 1, 2021
@tsteur tsteur added this to the 4.4.0 milestone Feb 1, 2021
@tsteur tsteur removed the c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. label Feb 1, 2021
@tsteur tsteur added c: Privacy For issues that impact or improve the privacy. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. labels Feb 1, 2021
@tsteur
Copy link
Member

tsteur commented Feb 1, 2021

Hi @unikitty37 thanks for creating this issue. From what I see by looking at the code it's actually not possible to do yet. You can only find out if consent was given or not pretty much. I guess the idea was that a user would manage this as part of their consent tool or custom consent implementation.

With eg hasRememberedConsent you can find out if the user has given you consent but you can't find out if the user has denied the consent or never given consent. If you do call forgetConsentGiven when a user declines consent, then it be technically doable to implement such a feature though.

We're basically setting a cookie like mtm_consent_removed (when forgetConsentGiven was called) and we set a mtm_cookie_consent cookie when consent was granted (by calling rememberConsentGiven). If neither of them exist then the user hasn't made any decision yet.

There's no tracker method to get this information somewhat easily though unfortunately.

@mattab mattab added c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. c: Tracking For issues related to getting tracking data into Matomo. c: APIs For bugs and features in the Matomo HTTP and plugin APIs. labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: APIs For bugs and features in the Matomo HTTP and plugin APIs. c: Documentation For issues related to in-app product help messages, or to the Matomo knowledge base. c: Privacy For issues that impact or improve the privacy. c: Tracking For issues related to getting tracking data into Matomo. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants