# Identify groups

Track the behavior of entire teams or organizations within your application. Pass a group when [identifying a user](https://betterstack.com/docs/rum/identify-users/), and the group shows up on the [Groups](https://rum.betterstack.com/team/0/groups ";_blank") page with all its users and sessions.

## Associate a user with a group

Add `group_id` and `group_name` to the `betterstack('user', ...)` call:

```javascript
[label Identify user with a group]
betterstack('user', {
  id: 'user_123',
  email: 'user@example.com',
  username: 'John Doe',
  group_id: 456,
  group_name: 'Acme Inc.',
});
```

Groups are keyed by `group_id`, falling back to `group_name` when no id is set. Use a stable identifier like your internal company or team id as `group_id`, and a human-readable `group_name` for display.

A user belongs to the group set by their latest identify call. Call `betterstack('user', ...)` again with a different group when the user switches teams or organizations in your application.

## What groups unlock

- **Groups page:** Every group appears on [Groups](https://rum.betterstack.com/team/0/groups ";_blank") with its first and last activity. See [Analyzing groups](https://betterstack.com/docs/rum/using-the-product/analyzing-groups/).
- **Drill-down:** Jump from a group to its users and sessions to see how a whole account uses your product.
- **Filtering:** Search sessions and events by `user.group_id` or `user.group_name`.

## Next steps

- [Analyzing groups](https://betterstack.com/docs/rum/using-the-product/analyzing-groups/): work with the Groups page.
- [Event funnels](https://betterstack.com/docs/rum/using-the-product/event-funnels/): measure conversion for your key journeys.
