> For the complete documentation index, see [llms.txt](https://developer.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.mediarithmics.io/querying-your-data/activities-analytics-queries.md).

# Activities analytics queries

The activity analytics endpoint has been designed as a cube to query user activities.

This API gives you programmatic access to user activities as a data cube. You get metrics with dimensions, filters, and within date ranges leveraging the [Activity analytics](/data-ingestion/activities-analytics.md) part of our multi-model database.

![](https://4196284719-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MMuoqM-5hJ5JY0WnAKL%2Fuploads%2FidmNpZOQByNZpeUJLOsJ%2FAnalytics%20cube%20queries%20datamart.png?alt=media\&token=6876c89b-6749-4f15-8031-63f8b0ad9398)

With the activities analytics API, you can create reports to answer questions like: &#x20;

* **Number of active users.** The metric is `users` and it has no dimensions or filter.
* **Number of active users per channel per day.** The metric is `users`, grouped by `channel_id` and `date_yyyymmdd` dimensions, without filters.
* **Number of sessions per day for users who had an activity of type AD\_VIEW on campaign 666.** The metric is `sessions`, grouped by the `date_yyyymmdd` dimension with filter clauses  `activity_type = AD_VIEW` and `origin_campaign_id = 666` &#x20;
* **Days with more than 200k transactions on a specific channel**. The metric is `number_of_transactions`, grouped ty the `date_yyyymmdd` dimension with filter clauses on `channel_id = 666`. Then a filter is applied on the calculated metric to only keep days with more than 200k transactions.

It can also be used to build custom dashboards. For more information, see [Dashboards](/dashboards.md).

{% hint style="info" %}

* Maximum recommended **5 queries per second.**
* Response time around **1 second**.
* Results date range for the **4 latest months**.
  {% endhint %}

## Quick start guide

Calling the API to get your first metrics is easy with your favorite tool that you already use to query other mediarithmics endpoints. See the [API Quickstart](/querying-your-data/activities-analytics-queries/api-quickstart.md) guide to get started. &#x20;

## Available endpoints

* [`user_activities_analytics`](/resources/data-cubes/reference.md#user_activities_analytics-endpoint) returns a customized report of your activities analytics data.

## Supported dimensions and metrics

See [Dimensions en metrics](/querying-your-data/activities-analytics-queries/dimensions-and-metrics.md) for the complete list of supported dimensions and metrics.

## How data cubes work

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 available in the specific documentation section.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.mediarithmics.io/querying-your-data/activities-analytics-queries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
