User properties
Tell datacub who a signed in user is with traits on identify, and describe what they do with properties on events.
What datacub knows about a user
| Property | Where it comes from |
|---|---|
| User ID | datacub.identify(userId): your own stable internal ID |
| Name, email, phone | datacub.identify(userId, { name, email, phone }), shown on the Users page and searchable |
| Other traits | datacub.identify(userId, { plan: 'growth', role: 'admin' }) |
| Account | datacub.identify(userId, { account }): their company, team or workspace ID |
| First and last seen, sessions, devices, countries, sources | worked out by datacub from their events |
| Everything they did | page views, screens, clicks and your custom events, with properties |
The Users page in the dashboard shows each user's timeline, built from these.
Traits
datacub.identify(user.id, { name: user.name, email: user.email, plan: 'growth', seats: 5 })Traits are sent with $identify the first time a user is identified on a browser or phone, and as $set when you call identify again with traits for the same user. Send them at login and when they change, not on every page load. The rules for name, email and phone.
Facts belong on events
Send the plan, the role or the step as a property of the event where it matters. Each event keeps the value it had at that moment, so a user who upgrades still counts as free in last month's funnel.
datacub.identify(user.id, { account: workspace.id })
datacub.track('subscription_started', { plan: 'growth', billing: 'yearly', seats: 5 })Never send
National or Iqama IDs, addresses, passwords, or anything a user typed, in any trait or property. Name, email and phone go only in their own three traits; anywhere else they are redacted (what datacub removes).