# Metrics

> Build product analytics for AI applications using natural language

Metrics let you track patterns in conversations that would be impossible to capture with traditional event-based analytics. Define what you want to measure using plain text — just like [policies](https://whitecircle.com/docs/2026-04-15/first-steps/policies.md) — and White Circle handles the rest.

## Example Use Cases

### Customer Support Bot

* Was the user's issue resolved?
* How often do users express frustration?
* How often do users ask for help?

### AI Code Assistant

* How often do users ask for bug fixes vs. new features vs. documentation?
* Are users asking follow-up questions after code generation?
* What programming languages are most requested?

### Educational Tutor

* Did the student understand the explanation?
* How often do users ask for simpler explanations?
* What topics generate the most questions?

### Sales Assistant

* Did the conversation lead to purchase intent?
* What objections come up most frequently?
* How often do users ask about pricing?

## How Metrics Work

Metrics let you define what you want to measure using plain text — just like [policies](https://whitecircle.com/docs/2026-04-15/first-steps/policies.md).

Each metric has two components:

- **Included Content**: Describe what should **count** toward this metric.
- **Excluded Content**: Describe what should be **excluded**, even if it seems similar.

> [!NOTE]
> Metrics are computed based on **only the last message** in the `messages` array. Previous messages provide context for the evaluation.

### Example: Feature Request Detection

To track how often users request new features:

* **Included:** "User asks for a new capability, requests functionality that doesn't exist, suggests improvements or additions"
* **Excluded:** "Bug reports, questions about existing features, general feedback without specific feature requests"

## Metrics vs. Policies

While metrics and policies use the same definition approach, they serve different purposes:

| Aspect           | Policies                   | Metrics                       |
| ---------------- | -------------------------- | ----------------------------- |
| **Purpose**      | Content moderation         | Product analytics             |
| **Processing**   | Real-time                  | Background                    |
| **API Response** | Immediate `flagged` result | Results arrive asynchronously |
| **Use Case**     | Block or flag content      | Understand user behavior      |

> [!NOTE]
> Metrics are processed in the background, which allows us to compute a large number of metrics at scale. There's a delay before results become available in your dashboard.

## Getting Started

Creating a metric follows the same workflow as policies:

1. **Open the Metrics Page**

   Navigate to the [Metrics page](https://eu.whitecircle.com/metrics) in your White Circle dashboard.

2. **Create a New Metric**

   Click **Add Metric** and give it a descriptive name like "Feature Requests" or "User Satisfaction".

3. **Define Your Metric**

   Write what should be included and excluded using plain language.

4. **Save and Start Tracking**

   Once saved, metrics are automatically computed for all requests sent to the [`/api/session`](https://whitecircle.com/docs/2026-04-15/session/check-session.md) endpoint.

## Viewing Analytics

On the platform, you can view analytics for each metric individually. This includes trends over time and breakdowns of matched content.

> [!TIP]
> We recommend sending [user metadata](https://whitecircle.com/docs/2026-04-15/session/metadata.md) with your requests from day one. This will allow you to segment metrics by user attributes and get meaningful insights as soon as dashboards with filtering capabilities become available.

***

## Next Steps

- **[Create a Metric](https://eu.whitecircle.com/metrics)**: Open the platform and define your first metric
- **[Add Metadata](https://whitecircle.com/docs/2026-04-15/session/metadata.md)**: Learn how to attach user information for richer analytics
