Skip to main content

Signature


Parameters

string
required
The name of the event. Use snake_case by convention.Max length: 255 characters.Examples: "feature_used", "export_clicked", "onboarding_completed", "video_watched"
object
Optional properties attached to this event. Values can be any JSON-serialisable type.

Examples

Simple event

Event with properties

Track a video watched


Using track events in targeting

Tracked events unlock the Behavior targeting rule type. You can show a flow only after a user has performed an action a specific number of times. Examples: To create a behavior rule: in the flow editor, open Targeting → Add rule → Behavior.

Event storage

Track events are:
  1. Sent to POST /api/v1/events in batches
  2. Stored in your Zenstep analytics (visible in the Analyze section of the dashboard)
  3. Used by the targeting engine to evaluate behavior rules on the next page load or navigation
Events are stored with a HMAC-SHA256 hash of the userId — no raw PII is stored.

Difference from analytics events

track() records custom behavioural events — things the user does in your app. Zenstep’s built-in analytics events (view, complete, dismiss, skip) are emitted automatically when a user interacts with a flow. You don’t need to call track() for those. Use track() when you want to:
  • Trigger flows based on in-app actions (not just URL patterns)
  • Build behavioral segments
  • Record custom conversion milestones