About conditions in triggers

Tag Manager

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.

Event conditions in Piwik PRO
Condition Description
contains

A condition is met when a given condition value is a substring of a variable value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL contains blog.

doesn’t contain

A condition is met when a given condition value isn’t a substring of a variable value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL doesn't contain blog.

starts with

A condition is met when a variable value starts with a given condition value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page path starts with /pricing.

doesn’t start with

A condition is met when a variable value doesn’t start with a given condition value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page path doesn't start with /pricing.

ends with

A condition is met when a variable value ends with a given condition value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL ends with /order.

doesn’t end with

A condition is met when a variable value doesn’t end with a given condition value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL doesn't end with /order.

equals

A condition is met when a variable value equals a given condition value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL equals https://example.com/blog.

Note: For a traffic source variable, you can set one of the following condition values: Direct, Referral, Social, Organic search, Campaign.

doesn’t equal

A condition is met when a variable value doesn’t equal a given condition value.

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL doesn't equal https://example.com/blog.

Note: For a traffic source variable, you can set one of the following condition values: Direct, Referral, Social, Organic search, Campaign.

regexp

A condition is met when a variable value matches a given regular expression (regexp).

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL regexp /product/[0-9]+/add-wishlist/.

regexp doesn’t equal

A condition is met when a variable value doesn’t match a given regular expression (regexp).

A variable value needs to be a string, number or boolean. For other types, this condition is never met.

Example: Page URL regexp doesn't equal /product/[0-9]+/add-wishlist/.

is true

A condition is met when a variable value is Boolean true.

If a variable value is a string "TRUE" or "true", this condition is not met.

Example: Returning visitor is true.

is false

A condition is met when a variable value is Boolean false.

If a variable value is a string "FALSE" or "false", this condition is not met.

Example: Returning visitor is false.

is set

A condition is met when a variable value is defined – it’s neither null nor undefined.

Example: Campaign is set.

is not set

A condition is met when a variable value is undefined or null.

Example: Campaign is not set.

is empty

A condition is met when a variable value is one of: null, undefined, an empty string (""), an empty array ([]), an empty object ({}).

Example: Campaign is empty.

is not empty

A condition is met when a variable value is none of: null, undefined, an empty string (""), an empty array ([]), an empty object ({}).

Example: Campaign is not empty.

matches

A condition is met when a clicked element matches a given selector (CSS or XPath).

Example: Click Element matches .cart > a.

Note: Available only for the Click Element variable.

doesn’t match

A condition is met when a clicked element doesn’t match a given selector (CSS or XPath).

Example: Click Element doesn't match .cart > a.

Note: Available only for the Click Element variable.

is a child of

A condition is met when a clicked element is a child of an element matched by a given selector (CSS or XPath).

A parent element is checked recursively up to 100 elements in the DOM.

Example: Click Element is a child of .footer.

Note: Available only for the Click Element variable.

isn’t a child of

A condition is met when a clicked element isn’t a child of an element matched by a given selector (CSS or XPath).

A parent element is checked recursively up to 100 elements in the DOM.

Example: Click Element isn't a child of .footer.

Note: Available only for the Click Element variable.

Was this article helpful?

Technical support

If you still have some questions, visit our community.
There’s always someone ready to help!

Back to help center