About conditions in triggers

For each trigger, you can set specific conditions. In this article, we’ll explain detailed rules of conditioning so that you could work with triggers more comfortably.

Trigger conditions in Tag Manager.

General conditions

Condition Description
contains condition is met when given string is a sub string of variable’s value; this comparison is made after both operands are converted to string
doesn’t contain condition is met when given string is not a sub string of variable’s value; this comparison is made after both operands are converted to string
starts with condition is met when variable’s value starts with given string; this comparison is made after both operands are converted to string
doesn’t start with condition is met when variable’s value doesn’t start with given string; this comparison is made after both operands are converted to string
ends with condition is met when variable’s value end with given string; this comparison is made after both operands are converted to string
doesn’t end with condition is met when variable’s value doesn’t end with given string; this comparison is made after both operands are converted to string
equals condition is met when variable’s value is equal to given string; this comparison is made after both operands are converted to string
doesn’t equal condition is met when variable’s value is not equal to given string; this comparison is made after both operands are converted to string
regexp condition is met when variable’s value matches given regular expression; pattern matching is made after both operands are converted to string. Examples:[cC]at will match either cat or Cat, and 2\d{3} will match a number between 2000 and 2999.
regexp doesn’t equal condition is met when variable’s value doesn’t match given regular expression; pattern matching is made after both operands are converted to string;
is true condition is met when variable’s value is boolean true; no type conversion is performed; that means you cannot use Constant variable type with value TRUE/true because that will be understood as string
is false condition is met when variable’s value is boolean false; no type conversion is performed; that means you cannot use Constant variable type with value TRUE/true because that will be understood as string
is set condition is met when variable is defined, that means when it is not null nor undefined.
is not set condition is met when variable is not defined, that means when it is null or undefined.
is empty condition is met when variable’s value is one of:
• 0 (a number zero, string zero will not met this condition).
• ” (an empty string).
• undefined.
• null. 5.false (boolean value).
• [] (an empty array – one can be passed via dataLayer or can be created with Custom JavaScript variable).
• {} (an empty object – one can be passed via dataLayer or can be created with Custom JavaScript variable).
is not empty condition is met when variable’s value is not one of:
• 0 (a number zero, string zero will not met this condition).
• ” (an empty string).
• undefined.
• null. 5.false (boolean value).
• [] (an empty array – one can be passed via dataLayer or can be created with Custom JavaScript variable).
• {} (an empty object – one can be passed via dataLayer or can be created with Custom JavaScript variable).

Conditions for traffic source

Condition Description
is same as equals
is not same as doesn’t equal

Conditions for a returning visitor

Condition Description
yes condition is met when visitor was on the page already
1st visit condition is met when user is visiting site for the first time

Conditions for click elements

Condition Description
matches condition is met when clicked element matches given CSS Selector or XPath selector
doesn’t match condition is met when clicked element doesn’t match given CSS Selector or XPath selector
is a child of condition is met when clicked element is a child of element matched by given CSS Selector or XPath selector; parent is checked recursively up to 100 elements in the html tag tree
isn’t a child of condition is met when clicked element is not a child of element matched by given CSS Selector or XPath selector; parent is checked recursively up to 100 elements in the html tag tree
Was this article helpful?

Be the first to rate this article.

Technical Support

If you have any questions, drop us a line at support_SPC@piwik_SPC.pro.

We’re happy to help!