Skip to content

mtm_consent cookie is not setting in browser after rememberConsentGiven #127

Description

@satyam1903

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions