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

PropertyWhere it comes from
User IDdatacub.identify(userId): your own stable internal ID
Name, email, phonedatacub.identify(userId, { name, email, phone }), shown on the Users page and searchable
Other traitsdatacub.identify(userId, { plan: 'growth', role: 'admin' })
Accountdatacub.identify(userId, { account }): their company, team or workspace ID
First and last seen, sessions, devices, countries, sourcesworked out by datacub from their events
Everything they didpage 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).