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.
identify connects your external_id (whatever you call users in your own database) to a Spotzee user record and updates that record’s traits. Until you call identify, the SDK records activity against an anonymous ID that the browser variants mint and persist for you.
Identify a known user
anonymousId yourself. The Node Client requires you to pass both IDs explicitly because it can’t safely persist them between calls.
How traits flow
Anything you put intraits lands as a top-level field on the user record. The set of traits Spotzee accepts is defined by your project’s data schema. Read Define custom user attributes for how to add, remove, or rename traits.
A few traits map to specific behaviour:
emailandphone: top-level fields the email and SMS channels read from. Pass them throughidentifyarguments rather than nesting them intraitsso the SDK puts them in the right place.timezoneandlocale: drive personalisation and send-time logic. Pass them throughidentifyarguments. The browser SDK does not infer them; if you want browser locale, readnavigator.languageand pass it in.
Anonymous to known: automatic alias
The firstidentify call after an anonymous session aliases the anonymous ID to your external_id. All prior anonymous activity now belongs to the known user. The browser SDK caches the external_id after this call, so subsequent track and identify calls carry both IDs automatically.
For server contexts where you already know the anonymous ID separately (for example, a user signed up server-side with a session you tracked earlier), call alias directly:
When to call identify
- On sign-up. First call after the user creates an account.
- On sign-in. So a user switching devices or browsers gets joined back to their record.
- When traits change. Updating profile data, plan, lifetime value, billing state. Identify is upsert: pass only the traits that changed.
identify on every page load with the same data. The platform deduplicates server-side, but the network call is wasted.
Worked example: link anonymous browse to checkout
Reset on sign-out
The SDK cachesexternalId for the lifetime of the page. To clear it (for example, on sign-out), drop the page reference to the client and create a new one:
BrowserClient mints a new anonymous ID. Subsequent activity is anonymous until the next identify.
Next steps
Track events
Trigger journeys and feed segments with custom events.
Define custom user attributes
Decide which traits Spotzee accepts.