Skip to main content
Trackly SMS supports sophisticated audience segmentation with nested AND/OR logic. This guide explains how to combine conditions effectively.

Logic Basics

AND (All Must Match)

When conditions are combined with AND, a contact must satisfy every condition:
last_clicked_at within 7 days
AND send_count > 3
AND state = "California"
A contact must have:
  • Clicked in the last 7 days, AND
  • Received more than 3 messages, AND
  • Be in California
Result: Only contacts meeting ALL criteria are included.

OR (Any Can Match)

When conditions are combined with OR, a contact must satisfy at least one condition:
state = "California"
OR state = "Texas"
OR state = "Florida"
A contact in California, Texas, OR Florida is included. Result: Contacts meeting ANY criterion are included.

Condition Groups

Creating Groups

Groups let you combine AND and OR logic. Each group is evaluated first, then groups are combined. Structure:
Group 1 (AND):
  - Condition A
  - Condition B

[AND/OR]

Group 2 (AND):
  - Condition C
  - Condition D

Example: Engaged OR New

Target engaged contacts OR brand new signups:
Group 1 (AND):
  - last_clicked_at within 7 days
  - click_count > 2

OR

Group 2 (AND):
  - signup_date within 3 days
  - send_count = 0
Matches:
  • Recent multi-clickers (engaged users)
  • Brand new signups who haven’t been messaged

Common Patterns

Geographic Targeting

Target multiple states or regions:
state = "California"
OR state = "Texas"
OR state = "Florida"
OR state = "New York"
For many values, consider creating a custom field like region = "West" instead of listing states.

Engagement Tiers

Target by engagement level:
last_clicked_at within 7 days
AND click_count > 5

Revenue-Based Segments

revenue_total > 100

Re-Engagement

Target lapsed contacts who were once active:
Group 1 (AND):
  - last_sent_at within 60 days
  - last_clicked_at NOT within 30 days

AND

Group 2 (OR):
  - click_count > 5
  - has_revenue = true
Matches: Contacts who:
  • Have been messaged recently
  • Haven’t clicked in a month
  • BUT previously showed strong engagement

Exclusion Logic

Exclude certain contacts using NOT conditions:
signup_date within 30 days
AND status NOT equals "unsubscribed"
AND last_sent_at NOT within 24 hours
Matches: New signups who are subscribed and haven’t been messaged today.

Advanced: Nested Groups

For complex logic, nest groups within groups:
Group A (AND):
  |-- Group 1 (OR):
  |     - state = "CA"
  |     - state = "TX"
  |
  |-- AND
  |
  |-- Group 2 (AND):
        - last_clicked_at within 14 days
        - click_count > 1
Matches: Contacts in CA or TX who clicked recently AND clicked more than once.

Evaluation Order

Conditions are evaluated in this order:
  1. Individual conditions within groups
  2. Groups combined (AND/OR between groups)
  3. Final audience membership
Example:
(A AND B) OR (C AND D)
  1. Evaluate A AND B → Result 1
  2. Evaluate C AND D → Result 2
  3. Result 1 OR Result 2 → Final audience

Debugging Audiences

Audience Too Small

If your audience is smaller than expected:
  • Check that conditions aren’t too restrictive
  • Try removing conditions one at a time
  • Preview to see what’s filtering contacts out
  • Verify the field has data (e.g., state may be blank)

Audience Too Large

If your audience is larger than expected:
  • You may have OR where you meant AND
  • Check group logic (groups OR’d together include more)
  • Add additional qualifying conditions

Preview Tool

Always use the preview before sending:
  1. Click Preview in the audience builder
  2. Review the sample contacts
  3. Check if they match your intent
  4. Adjust conditions if needed

Performance Tips

Fields like last_clicked_at, send_count, and signup_date are optimized. Custom fields may be slower on large lists.
Simple audiences with 2-3 conditions evaluate faster than deeply nested logic.
For audiences used frequently, the cached size updates periodically. Don’t refresh constantly.

Next Steps