> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Setting Analytics Exclusion

> Exclude or include a metric revision in analytics.

## Returns

Returns the updated [Metric](https://docs.galtea.ai/concepts/metric.md) object.

## Example

```python theme={"system"}
    metric = galtea.metrics.set_analytics_exclusion(metric_id=metric_id, excluded=True)
    print(f"Excluded from analytics at: {metric.excluded_from_analytics_at}")

    # Restore it: its results go back into scores and coverage.
    metric = galtea.metrics.set_analytics_exclusion(metric_id=metric_id, excluded=False)
```

This changes analytics aggregation only. Existing evaluations keep their scores and reasons — see [Revisions and Analytics](https://docs.galtea.ai/concepts/metric.md#revisions-and-analytics).

## Parameters

**metric\_id** `string` *required*

The ID of the metric revision to exclude or include.

**excluded** `bool` *required*

`True` to exclude the revision from analytics. `False` to include it again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.