Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getzenstep.com/llms.txt

Use this file to discover all available pages before exploring further.

url_path

Match the current page’s URL pathname (everything after the domain, before the query string).
{
  "type": "url_path",
  "operator": "starts_with",
  "value": "/dashboard"
}

Operators

OperatorDescriptionExample valueMatches
equalsExact match/pricingOnly /pricing — not /pricing/
containsSubstring matchanalytics/dashboard/analytics, /analytics/export
starts_withPrefix match/dashboard/dashboard, /dashboard/analytics, /dashboard/settings
regexRegular expression^/guide/\d+$/guide/42, /guide/1 — not /guide/abc
url_path matches against the pathname only — not the full URL. Query parameters and hash fragments are ignored. Use the query_param rule type to match on query strings.

user_attribute

Match a value from the attributes object passed to identify().
{
  "type": "user_attribute",
  "attribute": "plan",
  "operator": "equals",
  "value": "free"
}
Requires identify() to have been called with the attribute. If the attribute is not set on the current user, the rule evaluates to false.

Operators

OperatorDescription
equalsExact string match
not_equalsDoes not match
containsAttribute value contains the string
All attribute values are compared as strings. Numeric attributes (seats: 5) are cast to strings before comparison.

device

Match the current user’s device type.
{
  "type": "device",
  "device": "mobile"
}

Values

ValueDescription
desktopViewport width ≥ 1024px
tabletViewport width 768–1023px
mobileViewport width < 768px

query_param

Match a URL query parameter.
{
  "type": "query_param",
  "key": "ref",
  "value": "email"
}
Evaluates to true if the URL contains ?ref=email (exact value match).

always

Show to everyone, always. Useful as a catch-all or when you want a flow to appear on every page load.
{
  "type": "always"
}

behavior

Match based on how many times the user has performed a track() event. Requires the Grow plan.
{
  "type": "behavior",
  "event": "export_clicked",
  "operator": "eq",
  "value": 0,
  "windowDays": 7
}
Show the “Try CSV Export” tooltip to users who have never clicked export in the last 7 days.

Operators

OperatorDescription
gtEvent count is greater than value
gteEvent count is greater than or equal to value
ltEvent count is less than value
lteEvent count is less than or equal to value
eqEvent count equals value

windowDays

Optional. If set, only counts events within the last N days. If omitted, counts all-time events.

segment

Reference a saved Segment — a reusable named targeting configuration. Requires the Grow plan.
{
  "type": "segment",
  "segmentId": "seg_abc123"
}
Segments are created in Settings → Targeting → Segments. Using segments keeps your targeting rules DRY — update the segment once and all flows using it pick up the change automatically.

audience_membership

Match users who are members of a GA4 or Microsoft Clarity imported audience. Requires the Scale plan.
{
  "type": "audience_membership",
  "audienceId": "aud_xyz789"
}
Audiences are synced from GA4 or Clarity via the Settings → Targeting → Audience Sources integration.

group

Nest rules with their own logical operator inside a parent rule set.
{
  "type": "group",
  "operator": "or",
  "rules": [
    {
      "type": "user_attribute",
      "attribute": "role",
      "operator": "equals",
      "value": "admin"
    },
    {
      "type": "user_attribute",
      "attribute": "role",
      "operator": "equals",
      "value": "owner"
    }
  ]
}
Groups can be nested up to 5 levels deep.

Combining rules — full example

Show a “Upgrade to unlock analytics” flow only to:
  • Free-plan users
  • On the /analyze page
  • Who have viewed at least 3 analytics pages in the last 30 days
{
  "operator": "and",
  "rules": [
    {
      "type": "url_path",
      "operator": "starts_with",
      "value": "/analyze"
    },
    {
      "type": "user_attribute",
      "attribute": "plan",
      "operator": "equals",
      "value": "free"
    },
    {
      "type": "behavior",
      "event": "analytics_page_viewed",
      "operator": "gte",
      "value": 3,
      "windowDays": 30
    }
  ]
}