Identify groups

Track the behavior of entire teams or organizations within your application. Pass a group when identifying a user, and the group shows up on the Groups page with all its users and sessions.

Associate a user with a group

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

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 with its first and last activity. See 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