Three ids your app sends
| Id | Who sets it | What it is |
|---|---|---|
deviceId |
The browser SDK | This browser. Never rotates. Context only — it never decides who somebody is |
anonymousId |
The browser SDK | The current stretch before sign-in. Rotated by reset(), and only by reset() |
userId |
You | Your own id for a signed-in user, passed to identify() in the browser and on every server call |
The browser SDK creates deviceId and anonymousId at the first event the visitor’s consent
allows, never at init(). You only ever set userId.
The person is Togo’s conclusion
From those ids Togo works out the person, and gives each one a person_id. Your app never
sends a person_id, and one in a request is discarded: it is a conclusion Togo draws after the
events arrive, not an input.
user_id is yours; person_id is ours. A person exists from their first event, long before
they sign up — most people never have a user_id at all. Join your own data on user_id. Count
people in Togo by person.
When two ids become one person
identify(userId)merges. The first time a browser identifies, its anonymous history joins that user, so the visit before sign-up and the activity after it are one person.- Nothing else merges. Two anonymous visitors never merge with each other, and a device never
establishes who somebody is. Two
userIds on onedeviceId— a shared laptop — are two people. reset()at sign-out starts a new anonymous visitor on the device, so the next person to use it is not counted as the last one. Without it, everything they do is attributed to the previous user, and nothing can separate them afterwards.
Identify people when they sign in shows the calls.
What you can say about a person
Facts about a person — their plan, their signup date, their email — go on the person’s profile
with setPersonProperties(), never on events. A profile set before sign-in is kept and carries
forward when the person identifies. See Set person properties.
On the server
A server handles many people, so the server SDK takes the person on every call: the
same userId the browser uses, or the browser’s anonymousId forwarded for a visitor who has not
signed in. Use the same userId everywhere, or each user becomes two people.