Trigger based on cookie does not work

Hello there,

I am trying to create a blocking trigger in case a user denied the cookie consent agreement. So basically I have a cookie named cookie-consent where value can be true or false regarding user choice.
I created a trigger based on Match rule Cookie:cookie-consent equals false


Then I updated my tool action with a blocking trigger based on this trigger

But the result is {{ system.cookies.cookie-consent }} is empty in the debugger view. It’s also evaluated multiple times and I don’t know why.

Do you have any idea why it’s does not work ? Did I miss something ?
Thanks a lot in advance for your help

Try removing the - from your cookie name or wrapping it with backticks, Zaraz probably thinks you’re trying to deduct consent from system.cookies.cookie.

Thanks @yoav_zaraz the backticks helped. However I still got a problem. If a user come on the website for the first time the cookie is not set and then it’s seen as empty by Zaraz. Is there a way to match an empty or undefined cookie with the match rule ?
Thanks

You can try using regex to match an empty string?

^$