Integration
Identity & session attributes
setUserId, user_name, and custom identify fields.
Anonymous visitors get a stable label from fingerprint. After sign-in, call setUserId and identify() so Visitors, Lobby, and replay show real names and custom attributes.
Before and after
AnonymousVisitors list
Fluffy Cotton Candy
fp_a8f3c2e91b4d…
Stable anonymous label until you identify.
No setUserId or identify yet.
IdentifiedAfter login
Alex Morgan
acct_7f2a9c1e
user_name is the headline; user_id stitches sessions.
- → Tracuto.setUserId("acct_7f2a9c1e")
- → Tracuto.identify({ user_name: "Alex Morgan", plan: "pro" })
Fields
| Field | API | When | Notes |
|---|---|---|---|
| user_id | setUserId(id) | After login | Stable id from your auth system |
| user_name | identify({ user_name }) | After login | Display name in the dashboard |
| utm_* | automatic on tag load | Landing URL | utm_source, utm_medium, etc. from ?query on new sessions—Custom attributes |
| custom keys | identify({ key }) | Anytime | plan, cohort, etc.—shown under Custom attributes |
Example
javascript
if (window.Tracuto?.isReady?.()) {
window.Tracuto.setUserId(user.id);
window.Tracuto.identify({
user_name: user.displayName || user.email,
plan: user.plan,
cohort: user.cohort,
});
window.Tracuto.flush();
}
// On logout:
if (window.Tracuto?.isReady?.()) {
window.Tracuto.clearUserId();
window.Tracuto.flush();
}