Hi,
I am trying to enable/disable Matomo tracking based on user consent and use Matomo cookies to remember the user’s choice.
When the user accepts consent, I run:
public async grantConsent(): Promise {
this.matomo.rememberConsentGiven();
}
When the user rejects consent, I run:
public async revokeConsent(): Promise {
this.matomo.forgetConsentGiven();
}
The behavior I am seeing is:
When consent is revoked, the mtm_consent_removed cookie is created.
When consent is granted again, the mtm_consent_removed cookie is removed.
However, no new mtm_consent cookie (or any other consent cookie) is created after granting consent.
Is this the expected behavior in Matomo?
Does Matomo only remove mtm_consent_removed and then rely on normal tracking cookies (_pk_id, _pk_ses, etc.) instead of creating a separate consent-granted cookie?
Also, is calling only rememberConsentGiven() sufficient, or should setCookieConsentGiven() also be called before it?
Thanks!
Hi,
I am trying to enable/disable Matomo tracking based on user consent and use Matomo cookies to remember the user’s choice.
When the user accepts consent, I run:
public async grantConsent(): Promise {
this.matomo.rememberConsentGiven();
}
When the user rejects consent, I run:
public async revokeConsent(): Promise {
this.matomo.forgetConsentGiven();
}
The behavior I am seeing is:
When consent is revoked, the mtm_consent_removed cookie is created.
When consent is granted again, the mtm_consent_removed cookie is removed.
However, no new mtm_consent cookie (or any other consent cookie) is created after granting consent.
Is this the expected behavior in Matomo?
Does Matomo only remove mtm_consent_removed and then rely on normal tracking cookies (_pk_id, _pk_ses, etc.) instead of creating a separate consent-granted cookie?
Also, is calling only rememberConsentGiven() sufficient, or should setCookieConsentGiven() also be called before it?
Thanks!