Dashboards
Charts

Example

4min

Our task is to create a chart of daily email logs. We store all email logs in the 'Email logs' CMS object. In the logs, we have the statuses of each sent email (Sent - email was sent, Open - email was opened, etc.). Our goal is to create a chart that shows how many email statuses we have each day.

First, we need to create a new dashboard. We will name it - Email chart.

Document image


Then we need to add a chart.

Document image


First, we need to decide what type of chart will be best for us. I will use a spline chart. Before selecting a type of chart we need to select an entity in which the logs are stored. In our case it`s 'email logs'.

Document image


In the metrics section, we need to select a 'count unique values' metric. We need to count only unique logs because the customer can open one email multiple times, and if we count that in we won`t see the correct rate at which our customers are opening emails from us. We will select an Email ID property as a unique value (it`s the same for each duplicate log).

Document image


Then we need to set up the aggregation. First, we set the daily aggregation. This will show how many logs are created each day. In the 'aggregation' we should select 'Date histogram'. Select 'create date' in the property selection. Because we want to have a daily statistic, we need to select 'day' in the minimum interval.

Document image


Now we have the count of logs that are created each day, but we still can`t see the statuses of logs. To display statuses on the chart we should add a sub-aggregation.

We should select 'terms' in the aggregation setting because we need to aggregate the chart by email statuses. In the property section, we will select 'status'. Order and count can be ignored in this case (you need to raise 'count' if you have more than 10 different statuses).

Our chart will look like that now

Document image


We have a separate graph for each status.

If we want to check logs for only one month, we can specify the start and end date, then click save.

Document image




Updated 03 Mar 2023
Doc contributor
Did this page help you?