How to Use Targeting Rule Conditions
When using targeting rules, there are times you’ll need to check certain values to decide whether a rule should be
triggered. For example, you might want to check if the current page URL contains a specific UTM parameter before showing
a campaign to the visitor.
PageUni apps make this easy with targeting rule conditions. They let you define exactly when a rule should be
triggered—all with just a few simple settings.
What Is a Targeting Rule Condition
Simply put, it’s a condition used to determine whether a targeting rule is met.
Each condition includes a value to check and a requirement it needs to meet.
For example, suppose you want to target visitors only when the current page URL contains "utm_source=google". In this
case:
- The value to check is the current page URL
- The requirement is that it must contain the text "utm_source=google"
If the URL includes this text, the targeting rule will be met. If not, it won’t apply.
Targeting rule condition example
There are two types of targeting rule conditions: text-based and number-based. Each type uses its own set of operators,
like "Contains" or "Is less than." Here are some real-world examples:
- Current page URL contains "/collections"
Use this to target visitors who are browsing your collections pages.
- Traffic source (referrer) is empty
This helps you target visitors who landed on your site directly (no referral).
- Product price is greater than 1000
Great for targeting visitors who are viewing high-priced items.
Text-Based Targeting Rule Condition
Text-based conditions are used in targeting types like Current page URL, Traffic source, Store data, Cookie value, and
HTML element to decide when a rule should be triggered.
We offer a variety of operators to help you define how the text should be matched.
Contains
The "Contains" operator is used to see if the text includes a specific substring.
For example, in a Traffic source targeting rule, if you set "traffic source contains google.com," the following traffic
sources will pass the check:
- https://google.com
- https://www.google.com
But these won’t pass:
- https://facebook.com
- https://instagram.com
Contains
Does Not Contain
The "Does not contain" operator is the opposite of "Contains."
For example, in a Traffic source targeting rule, if you set "traffic source does not contain google.com," these traffic
sources will pass the check:
- https://facebook.com
- https://instagram.com
But these won’t pass:
- https://google.com
- https://www.google.com
Does not contain
Begins With
The "Begins with" operator is used to see if the text begins with a specific substring.
For example, in a Store data targeting rule, if you set "product title begins with Hat," these product title will pass
the check:
- Hat for Small Heads
- Hat for Woman
But these won’t pass:
- Small Hat
- Woman's Hat
- T-Shirt
Begins with
Does Not Begin With
The "Does not begin with" operator is the opposite of "Begins with."
For example, in a Store data targeting rule, if you set "product title does not begin with Hat," these product title
will pass the check:
- Small Hat
- Woman's Hat
- T-Shirt
But these won’t pass:
- Hat for Small Heads
- Hat for Woman
Does not begin with
Ends With
The "Ends with" operator is used to see if the text ends with a specific substring.
For example, in a Store data targeting rule, if you set "product title ends with Hat," these product title will pass the
check:
- Small Hat
- Woman's Hat
But these won’t pass:
- Hat for Small Heads
- Hat for Woman
- T-Shirt
Ends with
Does Not End With
The "Does not end with" operator is the opposite of "Ends with."
For example, in a Store data targeting rule, if you set "product title does not end with Hat," these product title will
pass the check:
- Hat for Small Heads
- Hat for Woman
- T-Shirt
But these won’t pass:
- Small Hat
- Woman's Hat
Does not end with
Is Empty
The "Is empty" operator checks if the text is blank.
For example, in a Cookie value targeting rule, if you set the condition to "cookie value is text and is empty," only
visitors whose cookie value is blank will match the rule.
Is empty
Is Not Empty
The "Is not empty" operator is the opposite of "Is empty."
For example, in a Cookie value targeting rule, if you set the condition to "cookie value is text and is not empty," the
rule will only apply to visitors who have a text value set for that cookie.
Is not empty
Is Equal To
The "Is equal to" operator checks if the text matches an exact value.
For example, in a Current page URL targeting rule, if you set "current page URL is equal to https://your.domain.com/,"
only the homepage URL will pass the check:
- https://your.domain.com/
The following won’t pass:
- https://your.domain.com/products/hat
- https://your.domain.com/collections/t-shirt
- https://your.domain.com/?utm_source=blog
Is equal to
Is Not Equal To
The "Is not equal to" operator is the opposite of "Is equal to."
For example, in a Current page URL targeting rule, if you set "current page URL is not equal to
https://your.domain.com/," these URLs will pass the check:
- https://your.domain.com/products/hat
- https://your.domain.com/collections/t-shirt
- https://your.domain.com/?utm_source=blog
Only the homepage URL won't pass:
- https://your.domain.com/
Is not equal to
Number-Based Targeting Rule Condition
Number-based conditions are used in targeting types like Store data, Cookie value, and HTML element to decide when a
rule should be triggered.
You can choose from a variety of operators to help you define how the number should be compared.
Is Less Than
The "Is less than" operator checks if the number is smaller than a specific value.
For example, in a Store data targeting rule, if you set "cart total price is less than 150," only visitors with a cart
total below 150 will trigger the rule.
Is less than
Is Less Than or Equal To
The "Is less than or equal to" operator checks if the number is smaller than or exactly equal to a specific value.
For example, in a Store data targeting rule, if you set "cart total price is less than or equal to 150," only visitors
with a cart total of 150 or less will trigger the rule.
Is less than or equal to
Is Greater Than
The "Is greater than" operator checks if the number is bigger than a specific value.
For example, in a Store data targeting rule, if you set "cart total price is greater than 150," only visitors with a
cart total over 150 will trigger the rule.
Is greater than
Is Greater Than or Equal To
The "Is greater than or equal to" operator checks if the number is bigger than or exactly equal to a specific value.
For example, in a Store data targeting rule, if you set "cart total price is greater than or equal to 150," only
visitors with a cart total of 150 or more will trigger the rule.
Is less than or equal to
Is Empty
The "Is empty" operator checks if the number has no value set.
For example, in a Cookie value targeting rule, if you set the condition to "cookie value is number and is empty," only
visitors whose cookie value is blank will match the rule.
Is empty
Is Not Empty
The "Is not empty" operator is the opposite of "Is empty."
For example, in a Cookie value targeting rule, if you set the condition to "cookie value is number and is not empty,"
the rule will only apply to visitors who have a number value set for that cookie.
Is not empty
Is Equal To
The "Is equal to" operator checks if the number matches an exact value.
For example, in a Store data targeting rule, if you set "product price is equal to 100," only product pages with a price
of exactly 100 will match the rule.
Is equal to
Is Not Equal To
The "Is not equal to" operator is the opposite of "Is equal to."
For example, in a Store data targeting rule, if you set "product price is not equal to 100," only product pages with a
price other than 100 will match the rule.
Is not equal to