Identities
anonymous_id, user_id, and how /v1/identify stitches them together.
Identifier
Lifecycle
Lives in
Set by
anonymous_id
import { getAnonymousId, setAnonymousId } from "@millimetric/track";
getAnonymousId(); // "u_8f3c1a..."
setAnonymousId("u_custom_42"); // override (e.g. from server-rendered HTML)track({
event: "form_submit",
anonymous_id: req.cookies.aid, // ← your job to pass this through
user_id: user.id,
properties: { form: "contact" }
});user_id
/v1/identify — stitching them together
When to call identify
Moment
Call identify?
The pre-/post-login stitch
traits
A device with multiple users
A user across multiple devices
Forgetting
See also
Last updated
Was this helpful?