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. Each event carries a name and a properties map, and optionally inline updates to the user’s profile.
Track an event
track is fire-and-forget. It returns immediately and the SDK pushes the event from a background coroutine.
externalId (when set) on every call. You don’t pass either explicitly.
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 Android 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, lists of strings or numbers, and shallow maps serialise cleanly. Deeper nesting works but is harder to segment on.
- Property names use snake_case in the source map. The SDK does not transform top-level keys inside
Map<String, Any>properties.
Update user traits inline with the event
Set or refresh traits on the user record without a separateidentify call:
TrackUser 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), not for routine updates.
Anonymous events
Track works without anidentify. Events fire against the SDK’s persisted anonymous ID and join back to the known user the first time you call identify.
Built-in retry
Eachtrack schedules a POST and retries up to three times on failure. The SDK does not block your code on the result; calls return immediately and run on the process-wide lifecycleScope.
For events you cannot afford to lose (Order placed, Payment processed), still send a backend duplicate via event ingestion. The SDK’s retry covers transient blips; a force-stop before the network call lands does not.
Push notification analytics
Bridge inbound FCM payloads to track so you can build segments on push receipt and engagement:Throughput and batching
Eachtrack is one HTTP request. The SDK does not batch. For high-frequency events (animation analytics, gameplay metrics), buffer in your app and send larger windows from your backend rather than one POST per event from the device.
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.