Targeting overview
How targeting works
Every flow in Zenstep has a set of targeting rules. When the Zenstep snippet loads on a page, it evaluates these rules against the current user and URL. If all rules match, the flow is eligible to show.
Targeting rules are evaluated client-side by the snippet — no server round-trip required. Rules are downloaded with the flow definition and cached in the browser.
Rule types
There are four categories of targeting rules:
1. URL rules
Show a flow only on specific pages.
URL path starts with /dashboard
URL path equals /settings/billing
URL path matches /users/*/profile (glob pattern)
See URL rules for the full reference.
2. User attribute rules
Show a flow based on properties you send via identify().
plan equals grow
role equals admin
createdAt before 7 days ago
Attributes are whatever you pass in the second argument to window.zenstep.identify(). See user attributes for supported operators.
3. Segment rules
Show a flow to users in a predefined segment (e.g., "Free plan users", "Enterprise trial"). Segments are reusable groups of attribute rules. See segments.
4. GA4 audience rules
Show a flow to users who are members of a Google Analytics 4 audience. Requires GA4 sync setup. See GA4 integration.
Rule logic
Within a flow, all rules are combined with AND logic by default — every rule must match for the flow to show.
Example:
- URL path starts with
/dashboardAND - user attribute
planequalsgrowAND - user attribute
createdAtwithin last 7 days
All three conditions must be true.
OR logic across rule groups is supported via Segments — create a segment with OR conditions, then reference it in your flow's targeting rules.
Frequency controls
In addition to targeting rules, each flow has a frequency setting:
| Frequency | Behaviour | | ------------------- | ---------------------------------------------------------------------- | | Once | Shows once per user. After completion or dismissal, never shown again. | | Every session | Shows on every page load where rules match. | | Until completed | Shows until the user completes the flow (not just dismisses it). |
Frequency state is stored server-side (keyed to the user hash from identify()). It persists across devices and sessions.
Testing your targeting
Use the Preview function in the Chrome extension to test a flow on your live site. In preview mode, targeting rules and frequency controls are bypassed — you always see the flow.
For production verification, open your site in an incognito window (which has no stored state) and navigate to the target URL with a user who matches your rules.
The most common targeting mistake is a URL rule that doesn't match the actual
path. Double-check whether your path has a trailing slash — /dashboard/ and
/dashboard are different values.
Was this helpful?
Related articles