Identify signed-in users
Tie Datasense visitors to your own user IDs, so the Visitors page shows names, emails and plans and merges a user's devices.
By default every visitor is anonymous, with a generated name and avatar. Once someone signs in, tell Datasense who they are:
js
// Once the user is signed in (calling it on every page load is fine)
window.datasense?.("identify", user.id, {
name: user.name,
email: user.email,
plan: user.plan, // any other traits: strings, numbers or booleans
})
// On sign-out, so the next person on this device starts fresh
window.datasense?.("reset")What it does
- The visitor's profile shows the name, email and traits you sent.
- Every device identified with the same user ID merges into one person, with one timeline.
- You can search visitors by name, email or user ID.
Rules
- User IDs are cut at 200 characters. Up to 20 traits, each a string, number or boolean.
- Call
reseton sign-out so the next person on a shared device starts fresh (cookie script only). - This sends personal data: mention it in your privacy policy and send only what you need.
- Through the API and MCP, names and emails need the
visitors:detailspermission.