Identify users
Tie anonymous visits to a real person with dzati.identify().
Once a visitor signs up or logs in, dzati.identify(...) attaches a stable identity to them — so the anonymous sessions they had before (their 1st, 5th, 15th visit) and every visit afterwards are tied to a real person you can recognise.
The call
dzati.identify({
user_id: 'john.doe@google.com', // required — an email or your own user id
name: 'John Doe', // optional
image: 'https://acme.com/u/42.png' // optional — absolute URL to an avatar
});- user_id (required) — a stable id for the user: their email, or your own internal id. This is the key we recognise them by.
- name (optional) — a display name; replaces the anonymous label in your dashboard.
- image (optional) — an absolute
https://URL to a profile image.
Call it as soon as you know who the user is — right after signup or login, or on any authenticated page.
Drop it anywhere — it only sends once
It's safe to put dzati.identify(...) in a shared layout that renders on every logged-in page. Dzati remembers who you've already identified in that browser and only makes a network request the first time — or if the user_id, name, or image actually changes. Repeat calls on later page views are a no-op, so you won't generate an extra request on every page.
What happens
- That visitor's whole journey — past and future events on this browser — becomes attributable to the
user_id. You don't need to re-tag anything. - When they return later, we already know who they are.
- If their cookies are cleared, just call
identify(...)again after they log in and they're re-linked.
dzati.track() is ready when your refund code runs.Was this helpful?
Still stuck? Email support