Skip to main content

Audience Builder

The Audience Builder provides a visual interface for defining targeting rules without writing code. Combine conditions using AND/OR logic to create precise audience segments.

Rule Structure

Each rule consists of three parts:

  • Field -- The user property to evaluate (e.g., role, device.type, traits.plan)
  • Operator -- The comparison to perform (e.g., eq, contains, gt)
  • Value -- The value to compare against (e.g., "admin", "mobile", 100)

Supported Fields

FieldDescriptionExample Value
userIdThe user's external identifier"user-42"
traits.*Custom user properties (dot notation)traits.plan, traits.department
roleThe user's role in your application"admin", "viewer"
device.typeDevice category"desktop", "mobile", "tablet"
device.osOperating system"Windows", "macOS", "iOS"
device.browserBrowser name"Chrome", "Firefox", "Safari"
browserBrowser name (shorthand)"Chrome"
locationLocation properties (as key-value map)location.country, location.region

Comparison Operators

The targeting engine supports 15 comparison operators:

OperatorDescriptionOperatorDescription
eqEqualsneqNot equals
gtGreater than (numeric)ltLess than (numeric)
gteGreater than or equallteLess than or equal
containsString includes / array includesnot_containsString excludes / array excludes
inValue in listnot_inValue not in list
existsField is present, not nullnot_existsField is absent or null
regexMatches regular expressionstarts_withString starts with prefix
ends_withString ends with suffix

String operators (contains, not_contains) are case-insensitive. Numeric operators (gt, lt, gte, lte) require both values to be numbers.

Combining Rules with AND/OR

Rules are organized into groups joined by a logical operator:

  • AND -- All rules in the group must match.
  • OR -- At least one rule must match.

Groups can be nested to express complex logic:

AND
device.type eq "desktop"
OR
role eq "admin"
traits.plan eq "enterprise"

This matches desktop users who are either admins or on the enterprise plan. An empty rule group evaluates to true by default.

Creating an Audience

  1. Go to Audiences and click Create Audience.
  2. Enter a name and optional description.
  3. Add rules using the field, operator, and value dropdowns.
  4. Switch between AND/OR logic and add nested groups as needed.
  5. Click Save to create the audience.

After saving, the audience is immediately available for targeting flows, tooltips, and other content.