Skip to main content

How targeting works

Every Zenstep flow has a targeting configuration — a set of rules that determine whether the flow should be shown to the current user on the current page. The targeting engine runs client-side in the browser (inside the Zenstep snippet) every time a page loads or the URL changes (SPA navigation). This means:
  • No server round-trip per evaluation — instant decision
  • Rules are evaluated against the current browser context (URL, user attributes, device, behaviour)
  • Targeting is evaluated against all published flows simultaneously

Anatomy of a targeting rule

Every rule has a type and evaluates to true or false. Rules are combined with and (all must match) or or (any must match) logic.
This targeting config shows the flow on any URL starting with /dashboard and only to users with plan = "free".

Rule types


Combining rules

Rules are combined at two levels:
  1. Top-level operator (and / or) — how the rules in the root array are combined
  2. Group rule — a nested rule that can contain its own rules and operator
This shows the flow on /pricing OR (on any dashboard page AND if the user is on the free plan).

Environments

You can restrict a flow to specific environments (staging vs production):
Zenstep detects the environment automatically based on hostname. You can override this by setting data-env on the snippet script tag:

Frequency controls

Targeting determines if a flow is shown. Frequency controls determine how often: Frequency is set per-flow in the flow editor, not in targeting rules.