# Clients

## Clients

The Clients section is presented in the form of default widgets, as well as a widget builder where you can display any necessary data. This section consists of the following subsections:

In the Clients section, you can see a summary of newsletters, messages sent and received, and the ratio of customers in a pie chart by connected channels.

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

By default, there are three widgets in the "Analytics" - "Clients" section, which will be described in more detail below.

Widgets can be swapped with each other: to do this, pull the widget by this button.

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

Then position the widget in the desired location.

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

### Default widgets

#### Summary widget

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

The default "Summary" widget is a summary of customer analytics, subdivided into several parts:

* An overview of the number of new customers by channel over a given period.

The example above shows how many and from which messengers (channels) customers came for the selected time period.

* There is a data on newsletters and messages, where you can see the number of sent and received messages by messengers and the number of realized mailings:
* Data for selected period.

If you want to view the summary for a different time period (current or previous day; month, year, or other period), click the calendar icon, then select the appropriate period.

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

When viewing statistics in widgets, you may notice a green circle in front of the numbers highlighted in black color and denoting the total number of messages/emails for the whole period - this is the data for the selected period of time.

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

#### Customers widget

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

This widget can also be conditionally divided into two components:

a) Total number of clients per year and per month displayed at the top of the chart.

b) A bar chart showing the period from January to December.

The current accounting month in the chart, for which the number of new clients is calculated and displayed at the top of the widget, is highlighted in blue, the other sub-accounting months - in light blue.

In this widget, you can also change the colors of the columns for better visibility.

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

Here, in the widget settings, you can also apply other filters for displaying statistics:

* By lists and tags.

To select the desired lists and labels, click the check mark next to each desired item.

* By channel.
* By funnel block.
* By customers.
* By tag.

Tag is a system variable. You can find it in the dialog with a customer.

### Customers by channels widget

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

This widget is presented as a pie chart that shows the ratio of the number of customers on different channels (messengers) to each other.

From the widget presented as an example, you can see:

a) the total number of new customers for the reporting period;

b) a diagram showing the ratios of the number of customers by different messengers;

c) messengers for which the statistics is sampled and the number of customers against the name of the channel (messenger);

d) reporting period (by clicking on the calendar icon, you can select the current or previous day, month, year or other time period).

### Widget creation

In order to create your widget, you need to click on the "Add Widget" button, where you can apply the desired functionality and display everything in the desired way.

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

In this case, an additional widget builder window will open where.

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

1. You choose the period to be displayed in the statistics: it can be a day (current or previous); month, year or any other period you prefer.
2. You can also customize the appearance of the widget at your discretion:

* Choice for the widget icon type: for example, for accounting the number of messages You can choose the dialog icon, if for training - the icon with confederate, etc.
* Type of diagram for displaying statistics: pie, bar, line, and simplified.

In the widget builder, you can customize the display by variable and also use conversion separately.

#### Variables

In the "Variables" tab, you must specify the values of the variable to account for the statistics.

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

In the example above, we specified the age variable, which is used to record the age of the customer in the bot. Since we specified "By customer variables", the system will read the values of customers according to this variable and will take into account only those who are 18 and older.

In your project you can use a variety of variables that exist in your project: it can be the amount of payments, for example, if you want to calculate statistics for a certain tariff; the city of residence, etc.

{% hint style="warning" %}
Each line in the displayed widget corresponds to the value of the variable you specified when setting it up.

**The maximum number of lines (variable values) is 6**
{% endhint %}

#### AND and OR operators

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

If you pass a single value for analytics, you can choose any of the operators. However, if you pass several values for analytics, it is worth understanding the difference between these filters:

1. Filtering by the "AND" operator denotes the inclusion of the values of all variables.

That is, if you select "And", the system will search for and include in the statistics only those who have multiple selected variable values at once.

For example, if you select the age variable (value of 18), and select the gender variable (value of male), and filter "AND", the system will only sample customers who are male over 18.

Conditionally, the system understands that you need a customer who is both over 18 and male. The system will not include other customers in the statistics.

#### **How AND works**

You can also do a search only by one variable.

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

If you write var1 = 1, var2 = 2, the system will return 0. This is done so that you can set some conditions like var1 != 1 AND var1 > 0 - in this case the system will return those clients whose variables are not equal to one or greater than zero (with values 2, 3, 4, etc.).

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

The variable name for the AND statement must be the same for all lines.

For example:

* per1 = 1 AND pre2 = 2 - is WRONG!
* per1 < 400 AND per1 > 4 is the correct spelling for variables.
  {% endhint %}

{% hint style="warning" %}
If you need to use variables as follows:

per1 = 1 AND pre2 = 2, then use the OR operator.
{% endhint %}

2. Filtering by the OR operator involves one of several values (or more).

Such a filter is used if you need a sample of customers with different values of variables: for example, you need customers either over 18 years old or living in New York

Then the OR operator will include in the sample all those who have one of the two variables age or city.

So the system understands conditionally that we need those who are either older than 18, OR living in New York.

**How OR works**

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

Variables : var1 = 1, var2 = 2, where the system looks for any customer who has at least one of them matching the selected value (you can pass it without a value - then the system just looks for its presence).

{% hint style="info" %}
Read what variables are and how to work with them in the [Variables](/chatbot/functions/variables.md) article.&#x20;
{% endhint %}

Then you can select the channels whose statistics will be taken into account in this widget.

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

You can keep track of statistics by specific lists and tags assigned to customers.

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

Of course, you can also use the schema builder to account for customers who are in a certain state of the funnel.

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

For example, based on the image above, we can account for customers who have deleted an appointment and subsequently view the percentage of successful transactions, which will help you understand exactly how to improve the quality of your business and take action.

Then, you can apply a filter to display unsubscribed customers or, conversely, exclude them from the view.

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

The next criterion by which you can implement the display of statistics is the tag.

A tag is a system variable that can be found in the customer dialog (it cannot be changed).

The tag should be entered in the appropriate field.

#### UTM tags

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

{% hint style="info" %}
To learn what UTM tags are and how to use them, we recommend reading the article “[How to pass parameters and UTM tags](/faq/questions/...transfer-utm-labels.md)”.
{% endhint %}

In the first field “Value name” you write the name you need to display the results in the diagram.

Next, in the field with the selection of UTM tags you will be presented with the already existing ones in the project.

<div data-with-frame="true"><figure><img src="/files/1PfBc8wwSElKxdsquw4l" alt="" width="299"><figcaption></figcaption></figure></div>

Then enter the desired label value - this can be any assigned value for these labels.

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

Similarly to creating a widget based on variables, there is a choice of filtering "all values" and "one of the values"

{% hint style="success" %}
If you are creating a widget based on several UTM tags and you need the final result to include ALL values, then use the "All values" operator.

If you need to display the results by one of the values, use the "One of the values" operator.
{% endhint %}

When you enter a value for a label, you can set a match:

1. equal to;
2. not equal to;
3. more;
4. greater than or equal to;
5. less;
6. less than or equal to.

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

{% hint style="warning" %}
In total, 6 values can be passed in one widget and no more.
{% endhint %}

Next choose which channels to use for UTM tags for statistics.

You can select several channels at once or just one at your discretion.

You can also use only those customers that are included in a list or have a label (NOT UTM) assigned to them for display in the widget.

#### Conversion

To calculate the conversion, use the tab of the same name in the widget builder.

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

The “What to count” field will help to display conversion rate by 4 criteria:

1. Quantity — counting the number of customers for a specific time period and for a specific event/category or site.

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

When counting the number, you can choose how to count the values for customers:

a) All customer passes

b) unique passing - counting unique users who passed through the funnel for the first time (this block where Analytics is configured).

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

1. **Sum of values** - the system adds up the quantities of the values to be considered for statistics;
2. **Average value** - the sum of all values of numbers divided by their number. Here is, for example, there were three payments: the first payment - 1999, the second payment -2455, and the third payment -3455. The median value would be 2,636 (add up all three payments and divide by their number - three).&#x20;
3. **The median value** is the number that is the middle value for a set of numbers. Take the example of the payouts with the previous values, where the first payout is 1999, the second payout is 2455, and the third payout is 3455. The median value in such a case will be the number 2455, standing strictly among the set of numbers.

In the “How to count” field, you choose to count percentages either from the first step or from the previous step.

No matter which calculation method you choose, the step settings will appear next.

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

Here you can choose to count data by funnel or by site.

In order for conversion to work according to the funnel, you need to install blocks with “Analytics” with the settings of event categories and events in the scheme of the builder.

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

{% hint style="success" %}
Read more about it in the article “What each field means in the editor” in the '[Analytics tab](/chatbot/builder/setting/analytics.md)' section.
{% endhint %}

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

The “Display steps for all values” checkbox is required to fully display the values when calculating statistics in the chart, if you need more detailed information in the widget.

If you want to display conversion by site, you can specify the necessary name in the “Step name” field (or leave it as default - then the name will be generated automatically) and select the necessary site.

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

In order for the site statistics to be taken into account, you need to check the box to save the data in the site page settings in the “Analytics” section.

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

In this case, the statistics will take into account the number of visits to the site (NOT unique customers).

#### Filters

The filter widget will help you display data filtered in a certain way by set values.

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

For example, you have several lists that include customers. This widget type will help you display the exact number of customers that are present in each of the lists and display them on the widget.

#### How to customize the widget?

First, you need to add the required number of values to display the data in the widget.

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

{% hint style="success" %}
The widget can accept a maximum of 6 values in total.
{% endhint %}

After that, select the necessary filter to display the number of customers.

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

If you don't set a step name, it will default to “Step 1”, “Step 2”, etc.

Then select the necessary filters to display:

1. Channels - the number of clients from a certain channel will be displayed.

For example, if you have several channels connected in your project, you can display several or all of them in the filter by ticking the necessary ones at your discretion.

2. Lists and Labels - The value displays the number of customers respectively in the lists and labels you have defined.

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

It is similar to channels. You can also select multiple lists/labels at once to display the customer by filters.

3. Funnel block - the step will express the number of customers by the corresponding funnel block(s).

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

3. By customers: unsubscribed, excluding them or displaying all of them.

You can apply it as an additional filter in the value for customers: for example, to view data on unsubscribed customers in certain channels.

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

When using the "Show unsubscribed only" filter, customers added during the specified time period will be displayed with the "Unsubscribe" status, regardless of when they unsubscribed.
{% endhint %}

5. The clients added with the Unsubscribe status will be displayed, regardless of when the user unsubscribed.
6. By tag, the system variable assigned to the customer.

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

### How to delete widget

To delete or duplicate a widget, you need to find the corresponding icon on the widget itself.

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

By clicking on the button, you will see a menu with the removal or duplication of the widget:

{% hint style="success" %}
Now you know how to create widgets and apply the necessary metrics to them.
{% 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/analytics/customers.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.
