Reputation: 165
I need help in setting up the exception in trigger firing based on specific cookies value.
It should look like that: If "my_custom_cookie_name" value is "0" then the tag isn't fired. Could you please help me with that? Where should I start? Which parameters should I pick to create such a condition?
Upvotes: 8
Views: 7407
Reputation: 382
For example, if you want to add a condition on the trigger of a pageview :
1. You need to create a custom variable (cookie first party) :
The value is the name of your cookie
2. Then, you need to create your trigger with a specific condition :
Upvotes: 10
Reputation: 32760
You can read a first party cookie variable with the name of your cookie - just go to variables/new and select 1st-party-cookie as variable type and enter the name of the cookie. Name your variable as you like it, e.g. "myCookie".
Then create a trigger of the type custom event, enable regex matching and enter ".*" (without the quotes).
Click "this trigger fires on some custom events". In the dropdown that appears select your "myCookie" variable, set "equals" as match type and "0" (without quotes) as value.
Use this as exception trigger.
Setting this up as custom event is the easiest way, since this way will the trigger will work on pageload, domReady, click, submit and all other events, standards or custom. Else you would have to set up an exception for every possible GTM event.
Upvotes: 8