Documentation Index
Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt
Use this file to discover all available pages before exploring further.
track sends a single event to Spotzee. Events drive journey entrances, segment membership, campaign triggers, and reporting. Every event carries a name and a properties bag, and optionally inline updates to the user’s profile.
Track an event
externalId and the auto-minted anonymousId for you. The Node Client requires you to pass at least one of them on every call.
Naming and structuring events
- Use a short, descriptive name in the past tense.
Order placed,Account upgraded,Subscription cancelled. Consistent verb tense pays off when you build segments. - Match the name across surfaces. A
track('Order placed')from the browser and one from your backend should be the same event so journeys fire once per order, not twice with different names. - Properties are flat key-value pairs. Strings, numbers, booleans, arrays of strings or numbers, and shallow objects all serialise. Nested objects are accepted but harder to segment on.
- Event property names follow the same camelCase-to-snake_case rule the SDK applies to identify traits.
Update user traits inline with the event
Set or refresh traits on the user record without a separateidentify call:
user object accepts email, phone, timezone, locale, and a nested data map for arbitrary traits. Use this when the trait change is the natural side effect of the event (a Plan upgraded event upserting the new plan value) rather than for routine updates.
Anonymous events
Track works without anidentify. Events fire against the SDK-managed anonymous ID and join back to the known user the first time you call identify.
Errors and retries
track is awaitable. A failed call throws an Error with the HTTP status, error code, and request_id. The SDK does not retry on your behalf. For non-blocking client-side use, fire and forget:
Order placed.
Throughput and batching
Eachtrack is one HTTP request. The SDK does not batch. For high-frequency client code (gameplay events, streaming product views), buffer in your app and send in larger chunks via the typed client or your backend.
Next steps
Trigger a journey from an event
Wire an event to a journey entrance.
Build a segment from events
Use event-frequency rules in segment definitions.