# User Tracking

User Tracking connects your LLM activity to the people using your application. By associating traces with user identifiers, you gain visibility into **individual consumption patterns**, can debug issues for specific users, and understand how different segments interact with your system. This feature is optional but highly recommended.

### Why User Tracking Matters

System-wide averages tell you how your application performs overall, but not how individual users experience it. User tracking lets you:

* Identify your heaviest consumers and **understand usage distribution**
* Spot users experiencing disproportionate **errors** or **latency**
* Compare **behavior patterns** across different user segments
* Track **individual user journeys** through your LLM application
* **Monitor** token usage, costs, and other metrics **on a per-user basis**
* Filter and segment traces to **debug user-reported issues**

***

### User Views

#### All Users View

This view lets you segment by overall token usage, number of traces, and total cost making it easy to **identify power users** and **usage patterns**.

<div data-with-frame="true"><figure><img src="https://708770081-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ICwJbq7EJdn5kBgXnQu%2Fuploads%2F4hEB8cfd9yx2RpTniXc0%2Fimage.png?alt=media&#x26;token=883b019b-20e0-47ab-b818-8dba65a92993" alt=""><figcaption></figcaption></figure></div>

#### Individual User View

Selecting a user opens their **detail page** with:

* Aggregated statistics (observations, traces, tokens, cost, active period)
* Complete trace history for that user
* Session history showing multi-turn conversations
* Score history for quality tracking

<div data-with-frame="true"><figure><img src="https://708770081-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1ICwJbq7EJdn5kBgXnQu%2Fuploads%2FGDfpfM210fPjjdfGVfmH%2Fimage.png?alt=media&#x26;token=6e439398-e8e9-4992-81ab-22f65ce0d044" alt=""><figcaption></figcaption></figure></div>

This view is useful for debugging user-reported issues, understanding power-user behavior, and auditing activity for compliance or support purposes.

***

### Properties of a User

| Property         | Description                                      |
| ---------------- | ------------------------------------------------ |
| **User ID**      | Unique identifier for the user                   |
| **First Event**  | Timestamp of the user's first recorded trace     |
| **Last Event**   | Timestamp of the user's most recent trace        |
| **Total Events** | Number of traces attributed to this user         |
| **Total Tokens** | Cumulative token consumption across all activity |
| **Model Cost**   | Accumulated cost of all operations for this user |

***

### Tracking Users

To track users, include a `user_id` when creating traces. This can be any **unique string** that identifies a user in your system: a username, email address, internal ID, or any other distinct identifier. The field is optional, but populating it unlocks the full set of **user-centric analytics**.

For details on how to set `user_id` on traces, see [Updating a Trace](https://docs.interactive.ai/govern/traces#updating-a-trace).
