About conditions in triggers

Tag Manager

Video tutorial: watch on YouTube

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 name Description
contains

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

The 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

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

The 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

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

The 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

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

The 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

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

The 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

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

The 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

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

The 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

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

The 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

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

The 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

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

The 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

This condition is met when a variable value is boolean true.

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

Example: Returning visitor is true.

is false

This condition is met when a variable value is boolean false.

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

Example: Returning visitor is false.

is set

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

Example: Campaign is set.

is not set

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

Example: Campaign is not set.

is empty

This 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

This 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

This 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

This 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

This 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

This 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 any questions, visit our community.
There’s always someone happy to help!

Back to help center