Tracking
Identify logged-in users
Use Umami's Distinct ID and session data features to associate analytics with specific users across sessions and devices, while maintaining privacy.
When to use this#
- Track individual user journeys across multiple visits.
- Understand how specific users interact with your product.
- Connect events from different devices to the same person.
- Build user profiles based on behavior history.
Step 1: Assign a Distinct ID#
When a user logs in, call umami.identify() with a unique identifier:
The ID can be any string up to 50 characters: a user ID, email, or hash. All subsequent page views and events in that session will be linked to this ID.
Step 2: Add session data (optional)#
You can attach additional properties to help identify and segment users:
Session properties appear in the visitor profile and can be used for filtering.
Step 3: View user activity#
Navigate to Sessions in your Umami dashboard. Use the search bar to find a specific Distinct ID:
- Enter the user's ID in the search field.
- Umami shows all sessions associated with that ID across the selected time range.
- Click on any session to see the full activity history: pages visited, events triggered, and timestamps. Since sessions linked to the same ID (e.g. from different devices) are combined automatically, this view shows the visitor's complete cross-device activity, not just the one session you clicked.
Framework examples#
React (after login)#
Next.js (App Router)#
Privacy considerations#
- Use internal user IDs rather than email addresses when possible.
- Umami stores session data server-side. No cookies are used.
- Users who are not logged in remain fully anonymous.
- You can use hashed identifiers (e.g., SHA-256 of the email) if you want to correlate data without storing PII.