# Analytics

To display client actions from the bot in the "Analytics" section, you can use event and value settings for analytics in the block settings within the Builder.

When you click the "Analytics" button, a data input form opens:

<div data-with-frame="true"><figure><img src="/files/bPZcpjwrGVMduG67cP6Z" alt=""><figcaption></figcaption></figure></div>

with fields:

**Event category** – a general name for certain events in the bot:

<div data-with-frame="true"><figure><img src="/files/jNYH8kTqBM1wZqbRaSiu" alt="" width="563"><figcaption></figcaption></figure></div>

For example, categories in the bot may include:

a) General actions: arrived, purchased, paid;\
b) General product categories: women's clothing, men's clothing, footwear, household goods, etc.;\
c) Service categories: haircuts, manicures, etc.

This field is optional for configuration.

Event name, for which statistics will be collected (Required field!).

<div data-with-frame="true"><figure><img src="/files/v5WVu6G8Ftlqko6yCji4" alt="" width="563"><figcaption></figcaption></figure></div>

A specific item from a general category.

For example, within the general actions category:\
a) arrived: from the Telegram bot, from the VK bot, from the WhatsApp bot;\
b) purchased: product1, product2, product3, etc.

This field is mandatory.

You can then specify a value for the event in the bot: for example, the client paid a specific amount, purchased a certain quantity of products, etc.:

<div data-with-frame="true"><figure><img src="/files/VOKVDkCoodnQ5pZUIOSb" alt="" width="563"><figcaption></figcaption></figure></div>

Event value – a number or a client/deal variable specified in the format #{cost}:

1. Specifying a numeric value:

<div data-with-frame="true"><figure><img src="/files/8uE0pqH8LTDKR4yhE1Am" alt="" width="563"><figcaption></figcaption></figure></div>

2. Specifying a value via a variable:

<div data-with-frame="true"><figure><img src="/files/4Ub4ohMlpHLyLL1fuCrh" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
The data is grouped (summed) by event name and category.
{% endhint %}

{% hint style="danger" %}
Please note!

Analytics events are not tracked in gray blocks (Trigger block, Fallback block), as these blocks are designed for sending notifications, validating client input in the bot, initiating broadcasts, and similar functions.\
Gray blocks are used to avoid disrupting the client's journey in the main funnel.
{% endhint %}

When a client goes through a block where events are configured, you can view the data in the "Analytics" section:

<div data-with-frame="true"><figure><img src="/files/TiRRAMnT9vIEGRz5KXJH" alt="" width="563"><figcaption></figcaption></figure></div>

You need to create a widget in the "Clients" section:

<div data-with-frame="true"><figure><img src="/files/vOxyb8iV1K5naZX52BK1" alt="" width="563"><figcaption></figcaption></figure></div>

Next, select the necessary settings:

<div data-with-frame="true"><figure><img src="/files/r00VyFUIJ2CzBRJxoz7S" alt="" width="375"><figcaption></figcaption></figure></div>

1. Specify the analytics period
2. Enter the widget name
3. Choose the data visualization type for the analytics (pie chart, bar chart, etc.)
4. Select the data to be displayed in the widget:

<div data-with-frame="true"><figure><img src="/files/nCVaUbSARkWbpoPapzyJ" alt="" width="563"><figcaption></figcaption></figure></div>

Next, follow these simple steps to set up analytics event tracking from the chatbot:

Step 1. Select the Conversions tab:

<div data-with-frame="true"><figure><img src="/files/kPxKV9uRwdPT4HvJ84s2" alt="" width="375"><figcaption></figcaption></figure></div>

Step 2. Specify the methods for calculating Analytics data:

<div data-with-frame="true"><figure><img src="/files/W7sZvd5xAawa6qY7ZXcb" alt="" width="563"><figcaption></figcaption></figure></div>

**What to count** – calculation parameters for each step:

<div data-with-frame="true"><figure><img src="/files/U3YsCIW8X6IPi8wXQ7ya" alt="" width="563"><figcaption></figcaption></figure></div>

* **Quantity** – the number of clients who went through the selected event.
* **Sum of values** – the total sum of the event values for all clients who went through it. This can show the quantity of goods sold or the total revenue from sales.
* **Average value** – the average event value for all clients who went through it. This can show how many units of a product are sold on average per client.
* **Median value** – the median event value for all clients who went through it. This provides a more accurate average by excluding extreme values.

**How to calculate percetages**

<div data-with-frame="true"><figure><img src="/files/ueCVQkDwoykZpwpmBywS" alt="" width="563"><figcaption></figcaption></figure></div>

* Count from the % previous step.
* Count from the first step.

Step 3. Add a step for calculation:

<div data-with-frame="true"><figure><img src="/files/wglP4TgvyqtrT09sscVc" alt="" width="563"><figcaption></figcaption></figure></div>

Step 4. Select the category (if any) and the event that you previously specified and saved in the bot block:

<div data-with-frame="true"><figure><img src="/files/AQm8k0U7DnfsHOVQoYcC" alt="" width="563"><figcaption></figcaption></figure></div>

If you need to display only a specific event value, enter the required value in the "Event value" field:

<div data-with-frame="true"><figure><img src="/files/NHt2qe5zN10c9hz1Hp6O" alt="" width="563"><figcaption></figcaption></figure></div>

If you want to display all values, leave the field empty.

{% hint style="info" %}
Other analytics features in MaviBot are explained in the article "[MaviBot Analytics](/analytics/dashboards.md)."
{% endhint %}

{% hint style="success" %}
Done!&#x20;

You’ve learnt how to work with the MaviBot chat-bot flow editor!
{% endhint %}


---

# 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://docs.mavibot.ai/chatbot/builder/setting/analytics.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.
