# Alerts

## Create a custom alert

Use alerts to track key data changes for your bot.

{% hint style="info" %}
Note: alerts can only be applied to metrics available in custom statistics. Refer to the **Annex** section to see all available metrics.
{% endhint %}

### First step: create a predefined source

Before creating an alert, you must first create a **predefined source**, which corresponds to the type of data your alert needs to track.

To do this, go to **Custom Statistics > Configuration > Predefined Sources**.

### Second step: configure your alert

1. Go to **Custom Statistics > Configuration > Alerts** and click on the "Add an alert" button.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2FTcF2lnaT4jQMGualoXLI%2Fimage.png?alt=media&#x26;token=bfd9f239-babb-41b4-bd04-a05711ddfabe" alt=""><figcaption></figcaption></figure>

2. Fill in the following fields:

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2FN25AUjDUR7VV1adbmC1t%2Fimage.png?alt=media&#x26;token=60ba59ff-2d4f-443c-8c0c-243f8c439625" alt=""><figcaption></figcaption></figure>

* **Label (required)** : This is the name of your alert.
* **Predefined Source** : Choose the predefined source you created from the dropdown list.
* **Trigger Type** : This corresponds to how the data will be displayed. You can choose between **Absolute** (data will be displayed as a number) and **Relative** (data will be displayed as a percentage).
* **Threshold** :

  * **Is less than** : The alert will trigger when the indicator is **below** the threshold.
  * **Is greater than** : The alert will trigger when the indicator is **above** the threshold.

  *For example, if you set an absolute minimum threshold of 10 on the number of conversations during a given period, you will receive an alert when the bot has fewer than 10 conversations during that period.*
* **Comparison Period** : This is a timeframe during which the threshold will be calculated. *For instance, if you set the period to "week," the alert will trigger if the total number of conversations during the week is below/above the defined threshold.*
* **Comparison To** (*available only when using a relative threshold*) : This allows you to specify the timeframe against which the comparison period will be compared.\
  \&#xNAN;*For example, if you set the comparison period as "day" with a relative minimum threshold of 10%, choosing "previous day" means the alert will trigger if there are fewer than 10% new conversations compared to the previous day. This feature is useful for monitoring the rate of change in a data source.*

3. Save your alert by clicking on "**Add**".
4. Your alert will appear in the top left corner of your screen.
5. You can delete your alert by clicking on the trash bin icon.

<figure><img src="https://264031769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPMvi3Izk7dvjl9HitZpp%2Fuploads%2Fj7TO0COu5iSQqAc32ZCH%2Fimage.png?alt=media&#x26;token=8a5bf3dc-9bae-4640-8d77-28cf6643cb48" alt=""><figcaption></figcaption></figure>

To view the results of your alerts, go to **Custom Statistics > Alerts**.
