user_id. When you send logs with that user_id, SeerStack automatically associates the log with these traits.
Identifying Users
Callusers.identify when a user signs up or updates their profile. You only need to send the fields that have changed.
- TypeScript
- Ruby
- cURL
Identity Fields
| Field | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | Your internal user ID (database primary key). |
email | string | No* | The user’s email address. |
name | string | No* | The user’s display name. |
attributes | object | No | Custom attributes for filtering and segmentation. |
Either
email or name must be provided when identifying a user.Automatic Enrichment
Once a user is identified, you can use their attributes in your dashboard filters.If you filter by
attributes.plan = 'enterprise', SeerStack will find all logs triggered by users with that plan, even if the log payload itself didn’t contain the plan name.Updating User Attributes
You can callidentify multiple times. Each call merges new attributes with existing ones.
- TypeScript
- Ruby
Best Practices
Use Stable IDs
Use your database’s primary key (e.g., UUID) as the
user_id, not an email address or username which might change.Identify Early
Call
identify as soon as your user logs in to ensure subsequent logs are correctly attributed.Keep Attributes Clean
Use consistent naming for attributes across your codebase. Prefer
snake_case for attribute keys.Don't Over-Identify
You don’t need to call
identify on every request. Once is enough until attributes change.