# Events ingestion monitoring

This page shows you how to start using the events ingestion monitoring API.

When we collect activities, we track the number of events that go through each step of the mediarithmics data pipeline.

This API is a mediarithmics [Data cube](/resources/data-cubes.md) and works similarly to [Activities analytics queries API](/querying-your-data/activities-analytics-queries.md).&#x20;

## Quickstart

<mark style="color:green;">`POST`</mark> `https://api.mediarithmics.com/v1/platform_monitoring/data_ingestion`

#### Request Body

| Name                                         | Type       | Description                                                                                                                                              |
| -------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| metrics<mark style="color:red;">\*</mark>    | array      | Array of [Metric](/resources/data-cubes/reference.md#metric) to retrieve.                                                                                |
| dimension\_filter\_clauses                   | object     | Filters to apply on dimensions before calculating the metric. For more information, see [FilterClause](/resources/data-cubes/reference.md#filterclause). |
| dimensions<mark style="color:red;">\*</mark> | Dimensions | [Dimensions](/resources/data-cubes/reference.md#dimension) to group metrics by.                                                                          |
| date\_ranges                                 | array      | Periods to analyze. Each date range is an object with a `start_date` and an `end_date`. See [DateRange](/resources/data-cubes/reference.md#daterange).   |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

Here is a sample [report request](/resources/data-cubes/creating-a-report.md#report-request) body payload with all the important properties:

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    // Retrieve the data in the specified date range
    // Mandatory
    // Tip : you can use relative date formats such as "now-7d/d"
    "date_ranges": [
        {
            "start_date": "2021-10-10T00:00:00",
            "end_date": "2021-10-25T23:59:59"
        }
    ],
    // List of dimensions to retrieve
    "dimensions": [
        {
            "name": "date_time"
        },
        {
            "name": "datamart_id"
        },
        {
            "name": "pipeline_step"
        }
    ],
    // List of metrics to retrieve
    "metrics": [
        {
            "expression": "event_count"
        }
    ]
}
</code></pre>

## Available pipeline steps

We monitor the number of events that reach the given ingestion steps:&#x20;

<table><thead><tr><th>Step</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>JS_TAG
</code></pre></td><td>Measure the number of events sent by the mediarithmics Javascript TAG </td></tr><tr><td><pre><code><strong>API
</strong></code></pre></td><td>Measure the number of events sent through the ingestion API<br><code>api.mediarithmics.com/v1/datamarts/{datamart_id}/user_activities</code> </td></tr><tr><td><pre><code>DOCUMENT_IMPORT
</code></pre></td><td>Measure the number of events sent through the USER_ACTIVITY imports with the <a href="/pages/-MMyZD5pdNorxg_SAsgj">document import feature</a></td></tr><tr><td><pre><code>EVENT_RULES
</code></pre></td><td>Measure the number of events that match configures rules</td></tr><tr><td><pre><code>ACTIVITY_ANALYZER
</code></pre></td><td>Measure the number of events that pass through activity analyzer plugins</td></tr><tr><td><pre><code>DOCUMENT_STORE
</code></pre></td><td>Measure the number of events that are stored in the mediarithmics platform.</td></tr></tbody></table>

## Retention

These aggregated stats are kept for 3 months.

## Supported dimensions and metrics

See [Dimensions and metrics](/advanced-usages/platform-monitoring/events-ingestion-monitoring/dimensions-and-metrics.md) for the complete list of supported dimensions and metrics.

## Learning more about data cubes

This endpoint is a mediarithmics [Data cube](/resources/data-cubes.md). You can find documentation on how data cubes work and which data cubes are availables in the specific documentation section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.mediarithmics.io/advanced-usages/platform-monitoring/events-ingestion-monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
