Identify Users
Connect anonymous Pieowl events to the users in your own database.
By default, Pieowl doesn't know which of your users a visitor is. To connect their events to a user in your database, identify them.
How it works
When a user logs in or signs up, call identify. This links their current session and all later events to the ID from your system.
pieowl.identify({
profileId: 'user_123'
});Adding user traits
You can also pass traits like name, email or plan. They show up on the user's profile in your dashboard.
pieowl.identify({
profileId: 'user_123',
firstName: 'Jane',
lastName: 'Doe',
email: 'jane@example.com',
properties: {
company: 'Acme Inc',
plan: 'pro',
},
});Standard traits
These keys have their own fields on the profile, so they display correctly in the dashboard:
firstNamelastNameemail(must be a valid email address)avatar(must be a URL)
Put everything else, like company or plan, inside properties.
Best practices
- Call on login: Identify the user right after they log in.
- Call on update: If a user changes their profile, call
identifyagain with the new details. - Unique IDs: Use a stable ID from your database (like a UUID), not an email address or username that might change.