# Identify Users

URL: https://pieowl.com/docs/get-started/identify-users



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 [#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.

```javascript
pieowl.identify({
  profileId: 'user_123'
});
```

Adding user traits [#adding-user-traits]

You can also pass traits like name, email or plan. They show up on the user's profile in your dashboard.

```javascript
pieowl.identify({
  profileId: 'user_123',
  firstName: 'Jane',
  lastName: 'Doe',
  email: 'jane@example.com',
  properties: {
    company: 'Acme Inc',
    plan: 'pro',
  },
});
```

Standard traits [#standard-traits]

These keys have their own fields on the profile, so they display correctly in the dashboard:

* `firstName`
* `lastName`
* `email` (must be a valid email address)
* `avatar` (must be a URL)

Put everything else, like company or plan, inside `properties`.

Best practices [#best-practices]

1. **Call on login**: Identify the user right after they log in.
2. **Call on update**: If a user changes their profile, call `identify` again with the new details.
3. **Unique IDs**: Use a stable ID from your database (like a UUID), not an email address or username that might change.
