Conflict between custom event & pageview in triggers and exceptions

We run our “consent management” based on cookie values set on our own code and we’re having a weird issue.

Here’s the setup we’re (trying to) run (I’m dumbing it down a bit, we have more consent levels etc but that’s not the problem)


  • Pageview
  • Consent check (a custom event we fire when the user gives or doesn’t give consent, in order to not lose the initial pageview & tracking when they do give consent)
  • Exception: Pageview trigger for when the user has not given consent (cookie value is empty/null/etc)
  • Exception: Pageview trigger for when the user has given consent (cookie value is true)


  • Matomo analytics with
    • Pageview trigger
    • Exception for consent
    • Exception for no consent

Up until here, this works. But not we’re not tracking the initial pageview once the user gives consent on their first visit.

We also add the “Consent check” trigger to the tag for that. But then it keeps being blocked by the exception (which are based on cookie values and which work or a regular “pageview”).

In an attempt to debug this, I created a second Matomo Analytics tag, gave it only the Consent check trigger and I created new exception triggers that also fire on the custom event in question and not pageview. And that works.

That would mean creating 2 tags for every event that would otherwise just be a pageview tag, which is far from optional.

The exception triggers settings work with the cookie values and are configured correctly, as they fired or don’t fire matching the user’s preference on a normal pageview.

In summary, is this a bug? It seems that combining triggers of multiple times and exceptions of multiple types brakes things.


Hi @janhenckens
Your configuration is complicated to understand… but I think I get it…
As MTM has been built, the behavior you described is expected…

Maybe you can do like this:
Variable vConsentGiven from cookie
Trigger tAcceptConsent of type custom event (don’t forget to update also the cookie consequently)
Trigger tPageView of type page view only when vConsentGiven == true
Tag of type Matomo Analytics when tAcceptConsent or tPageView

That should do the job!