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.
The window.zenstep object
After the Zenstep snippet loads, it exposes a global window.zenstep API. The snippet initialises synchronously by installing a pre-init queue, so you can call any method before the script has fully loaded — calls are queued and replayed on init.
Queue behaviour
The snippet uses the GA4 dataLayer pattern. Before the snippet bundle has evaluated,window.zenstep is a stub that captures calls:
Methods
| Method | Description |
|---|---|
identify() | Associate the current browser session with a known user ID and optional traits |
track() | Send a custom behavioural event for use in targeting rules |
Calling conventions
All methods are fire-and-forget — they do not return a Promise. Errors are caught internally and logged as warnings to the browser console. Your code will never throw due to a Zenstep API call.Identity state
Zenstep persists identity state inlocalStorage under the key zenstep_identity. The identity survives page reloads but is cleared when the user clears their browser data or you call identify() with a new user ID.
An anonymous ID (zenstep_anonymous_id) is created on first load and persists across page reloads before identify() is called. This allows Zenstep to track behaviour and show flows to unauthenticated users.