Anonymous and identified users: IDs, emails, and traits
Anonymous activity uses a server-derived daily ID. Identified activity carries an explicit account ID from your app. Email is an optional property; it is not an automatic account-merging rule.
Choose a stable account identifier
Use the immutable user ID from your application database, such as user_123. Email is convenient to display but can change, and a shared or recycled address can complicate identity. The SDK accepts a string; choosing its meaning is your application’s responsibility.
The profile display prefers an available email trait, then user ID, then anonymous ID. That preference changes presentation, not the primary identity key. Users and Anonymous tabs separate known account IDs from daily anonymous identities.
Identify after authentication
Call identify after login and after a fresh authenticated page load. The SDK stores the current user ID in memory, so a reload does not silently restore it from analytics storage. Clear the ID on logout. Events sent before identify may lack user_id.
Identity and an identified event
await analytics.identify('user_123', { email: 'person@example.com', plan: 'pro' });
analytics.track('report_exported', { format: 'csv' });
analytics.clearUserId();Merge partial properties by key
An identify update with plan does not prevent another update with vip. Tinybird materializes one aggregate state per project, user ID, and trait key; reads merge those states into the profile. For a repeated key, the latest received update wins, with a deterministic message-ID tie-break.
An explicit null is retained as a property value. It is not a full profile-deletion command. Custom properties edited in the profile use the same analytics update path. A schema of arbitrary trait names does not mean arbitrary nested property values are supported.
| Update | Profile state |
|---|---|
| {plan: 'pro'} | {plan: 'pro'} |
| {vip: true} | {plan: 'pro', vip: true} |
| {plan: 'team'} | {plan: 'team', vip: true} |
Be explicit about history
Sending the same account ID on future days can connect those explicitly identified events. It does not justify silently assigning every earlier anonymous event to that account: multiple people can share request characteristics.
First/last attribution fields summarize what was observed for the chosen identity. An anonymous profile is bounded by daily identity. Profile deletion and retention controls need their own documented operational procedure; do not treat null traits as an erasure request.
Frequently asked questions
Can I identify with email?
The API accepts any valid string ID. Prefer a stable internal account ID and use email as an optional trait.
Do partial traits erase earlier keys?
No. Traits merge per key, and a later value updates that key.
Are profile traits stored in Supabase?
No. They are materialized from identify events in Tinybird.