Skip to main content

Using Conditions in Data Rules

Learn how to target widgets using different types of conditions

Tom Nipravsky avatar
Written by Tom Nipravsky
Updated over a month ago

Conditions determine WHEN your Data Rule applies. They answer the question: "Should this rule show products right now, for this customer, on this page?"

How Conditions Work

Conditions check something about the current context:

  • Who the customer is

  • What's in their cart

  • What page they're on

  • When they're shopping

  • Where they're located

If all conditions are met, the rule's actions run. If any condition fails, the rule doesn't apply.

Customer Conditions

Use these when you have customer data from logged-in users.

Is Logged In

Show rule based on whether the customer is signed in.

Use case: Show personalized recommendations to logged-in users

  • Operator: is true

Use case: Show popular items to guest shoppers

  • Operator: is false

Customer Tags

Show rule when the customer has specific Shopify customer tags.

Use case: Show VIP products to tagged VIP customers

  • Operator: contains

  • Value: VIP

Use case: Exclude wholesale customers from retail promotions

  • Operator: does not contain

  • Value: wholesale

Purchased Products

Show rule based on products the customer has previously bought.

Use case: Show accessories for products they own

  • Products: Select previously purchased products

Use case: Show "buy it again" for consumables

  • Products: Products they've ordered before

Customer Segments

Show rule when customer belongs to specific Shopify customer segments.

Use case: Target high-value customers

  • Segment: High Spenders

Use case: Target customers who haven't purchased in 90 days

  • Segment: At Risk

Total Spent

Show rule based on customer's lifetime spending.

Use case: Show premium products to high spenders

  • Operator: greater than

  • Value: 500

Use case: Show budget options to new customers

  • Operator: less than

  • Value: 100

Viewed Products (Customer)

Show rule based on products the logged-in customer has viewed.

Use case: Show alternatives to products they've browsed

  • Products: Select viewed products

Visitor Conditions

Use these for all visitors, regardless of login status.

Is New Visitor

Show rule for first-time visitors to your store.

Use case: Show welcome offer to new visitors

  • Operator: is true

Is Returning Visitor

Show rule for visitors who have been to your store before.

Use case: Show "welcome back" recommendations

  • Operator: is true

Use case: Target first-time visitors differently

  • Operator: is false

Viewed Products (Visitor)

Show rule based on products viewed in the current session.

Use case: Show "continue browsing" recommendations

  • Products: Recently viewed products

Cart Conditions

Use these when the widget should depend on cart contents or value.

Cart Subtotal

Show rule based on cart value.

Use case: Show free shipping products when cart is close to threshold

  • Operator: greater than

  • Value: 40 (if free shipping at $50)

Use case: Show premium upsells for high-value carts

  • Operator: greater than

  • Value: 150

Items Count

Show rule based on number of items in cart.

Use case: Show bundle deal when cart has 2+ items

  • Operator: greater than or equal

  • Value: 2

Use case: Encourage adding more with single-item carts

  • Operator: equals

  • Value: 1

Cart Contains Products

Show rule when specific products are in cart.

Use case: Show compatible accessories when laptop is in cart

  • Products: Select specific products

Cart Product Tags

Show rule when any cart item has specific tags.

Use case: Show outfit completers when clothing is in cart

  • Operator: contains

  • Tag: clothing

Use case: Show skincare routine when makeup is in cart

  • Operator: contains

  • Tag: makeup

Cart Product Type

Show rule based on product types in cart.

Use case: Show accessories when electronics are in cart

  • Operator: contains

  • Value: Electronics

Cart Product Vendor

Show rule when products from specific vendors are in cart.

Use case: Show other Nike products when Nike is in cart

  • Operator: contains

  • Vendor: Nike

Cart Product Collections

Show rule when products from specific collections are in cart.

Use case: Cross-sell from complementary collection

  • Collection: Summer Essentials

Page Conditions

Use these to target specific pages.

URL

Show rule when URL matches a pattern.

Use case: Show seasonal products on holiday landing pages

  • Operator: contains

  • Value: /holiday/

Use case: Target specific collection URLs

  • Operator: contains

  • Value: /collections/summer

Use case: Show special offers on sale pages

  • Operator: starts with

  • Value: /sale

Time Conditions

Use these for time-based targeting.

Hour

Show rule during specific hours of the day (24-hour format).

Use case: Show lunch specials during noon hours

  • Operator: between

  • Value: 11 and 14

Use case: Show late-night deals

  • Operator: greater than

  • Value: 21

Day of Week

Show rule on specific days.

Use case: Weekend promotions

  • Operator: is one of

  • Values: Saturday, Sunday

Use case: Monday flash sales

  • Operator: equals

  • Value: Monday

Date

Show rule on specific dates or date ranges.

Use case: Black Friday promotion

  • Operator: equals

  • Value: 2024-11-29

Use case: Holiday season

  • Operator: between

  • Value: 2024-12-01 and 2024-12-31

Klaviyo Conditions

These conditions require connecting your Klaviyo account to Triom.

Segment Membership

Show rule when visitor belongs to a Klaviyo segment.

Use case: Show personalized products for engaged subscribers

  • Segment: Engaged Email Subscribers

Use case: Win-back offers for churned customers

  • Segment: Churned Customers

Combining Conditions

You can use multiple conditions together. All conditions must be true for the rule to apply.

AND Logic (All Must Match)

Add multiple conditions—all must be met.

Example: Premium accessories for high-value logged-in customers

  • Condition 1: Customer is logged in

  • Condition 2: Total spent greater than 200

  • Result: Both must be true

Condition Groups

Group related conditions for complex logic.

Example: Target VIP customers OR high cart value

  • Group 1: Customer tags contains VIP

  • Group 2: Cart subtotal greater than 200

  • Logic: Either group can match (OR between groups, AND within groups)

Condition Operators

Different operators for different comparisons:

Text Operators

  • equals - Exact match

  • does not equal - Not exact match

  • contains - Includes text

  • does not contain - Excludes text

  • starts with - Begins with text

  • ends with - Ends with text

Number Operators

  • equals - Exact number

  • does not equal - Not that number

  • greater than - Above value

  • greater than or equal - Above or equal

  • less than - Below value

  • less than or equal - Below or equal

  • between - Within range

Boolean Operators

  • is true - Condition is true

  • is false - Condition is false

Collection/Product Operators

  • is in - Belongs to

  • is not in - Does not belong to

  • is one of - Matches any in list

Common Patterns

High-Value Customer Upsell

  • Condition: Customer is logged in + Total spent > $200

  • Action: Premium product recommendations

New Visitor Welcome

  • Condition: Is new visitor

  • Action: Best sellers

Cart Value Booster

  • Condition: Cart subtotal < free shipping threshold

  • Action: Low-cost add-ons

Returning Customer Win-Back

  • Condition: Is returning visitor + Cart is empty

  • Action: Previously viewed products

Did this answer your question?