> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crispstats.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> CrispStats is a hosted, privacy-first web analytics product. It has no self-hosted edition, no session replay, no heatmaps, no A/B testing, no mobile SDKs and no data import except a site's history from a Plausible export (Settings, Import and export).
> The script global is crispstats(...), site keys start with cs_pk_ and secret API keys start with cs_sk_. The script is served from https://in.crispstats.com/d.js and the REST API lives at https://crispstats.com/api/v1.
> There is no npm package to install. Integrations copy the script tag, the queue stub, crispstats.d.ts and proxy code from these docs or from Settings, Tracking code in the dashboard. A first-party proxy forwards one path of the site to https://in.crispstats.com/p/ and forwards only content-type, user-agent, accept-language, referer, origin, if-none-match and x-forwarded-for, never cookies.

# Get alerted when traffic, revenue or site health changes

> Create CrispStats alert rules as a sentence, choose how often they repeat, send them to your channels, test each channel and check what was delivered.

CrispStats alerts tell you when something changes on a site: traffic spikes or drops, a payment arrives, a monitor goes down, a new JavaScript error appears. You build each rule as a sentence on the **Alerts** screen, and CrispStats sends a notice to the email, Slack, Discord, Telegram or webhook channels you choose. Every plan includes alerts.

Rules belong to one site. Channels belong to your workspace, so every site's rules can use them.

## Create your first alert

**1. Add a channel**

Open the site, then **Alerts** in the sidebar. Under **Notification channels**, select **Add channel**, pick where alerts go and enter the destination. Owners and admins can add channels. See [channels](https://docs.crispstats.com/alerts/channels.md) for each kind.

You can skip this step. A rule without a channel still records each time it fires in **Recent deliveries**.

**2. Send a test**

Select **Send test** next to the channel. The test arrives within about a minute, and a toast tells you whether it was sent. See [test a channel](#test-a-channel).

**3. Create a rule**

Under **Rules**, select **New alert**. Owners, admins and members of the site can create rules.

1. In **Watch for**, pick what to watch, for example **Traffic spikes** or **A monitor goes down**.
2. Adjust the sentence. Every part you can change is a menu, for example: Tell me when visitors in the last **hour** are **3×** the usual.
3. Optionally give the rule a **Name**. It is shown in the notification. Left empty, the rule is named after its type, such as **Traffic spike**.
4. Pick how often it may **Repeat**. See [cooldown](#cooldown).
5. Under **Notify**, tick the channels to send to. A new rule starts with every channel that is switched on.

Select **Create alert** to save the rule. It starts watching straight away.

When a site has no rules yet, the screen suggests three to start with: **Traffic spike**, **Site is down** and **New JavaScript error**. Select **Create** to add one with its defaults and every channel that is switched on, or **Adjust first** to open it in the form.

For every rule type, its threshold and its windows, see [alert rule types](https://docs.crispstats.com/alerts/rule-types.md).

## How alerts are checked

A job runs every minute. It looks at the rules that are due, records a firing for each rule whose condition is met, and sends it to the rule's channels. How often a rule is due depends on its type:

* Traffic rules (spike, drop, no traffic) are checked once per full hour of the site's timezone, a few minutes after the hour ends.
* New errors, error spikes, goals and payments are checked every minute.
* Revenue milestones are checked every 5 minutes, and usage limits every 15 minutes.
* Web vitals rules are checked every 5 to 60 minutes, depending on their window.
* Monitor down rules are not polled: they fire the moment an incident opens or closes.

The same window, incident, payment batch or milestone never fires twice for a rule, whatever the cooldown.

## Cooldown

The **Repeat** setting is the rule's cooldown: the shortest time between two notices from it.

| Option | Cooldown |
| - | - |
| **Every time** | None |
| **At most every 30 minutes** | 30 minutes |
| **At most once an hour** | 1 hour |
| **At most every 3 hours** | 3 hours |
| **At most every 6 hours** | 6 hours |
| **At most once a day** | 1 day |

What happens during a cooldown depends on the rule:

* **Traffic rules** skip any window that trips during the cooldown. It is not reported later.
* **New error** and **payment received** rules wait until the cooldown ends, then report what happened since their last notice (going back at most one day), in one notice.
* **Monitor down** rules use the cooldown to suppress flapping. If the same monitor goes down again within the cooldown of its last down notice, the notice waits until the cooldown ends. If the monitor is back up by then, nothing is sent.
* **Other rules** are not checked during the cooldown, and are checked again when it ends.

Each rule type has its own default cooldown, listed in [alert rule types](https://docs.crispstats.com/alerts/rule-types.md).

## Triggered and recovered notices

Most rules send one kind of notice, when their condition is met. **Monitor down** rules send two:

* A **down** notice when an incident opens, with the cause, the status code and when it went down.
* A **back up** notice when the incident closes, with how long it was down. A back up notice is only sent for an outage whose down notice was sent.

Every notice has a plain headline with the number in it, such as "Traffic is 3.2× normal on example.com", a short summary, the numbers that tripped the rule, an **Open dashboard** link to the matching screen and a **Change or mute this alert** link to the Alerts screen. What each channel shows is described in [channels](https://docs.crispstats.com/alerts/channels.md).

## Manage rules

Each rule in the list shows its sentence, its channels (or **No channel, log only**), its repeat setting and when it last fired.

* Use the switch next to a rule to turn it off without losing it. A rule that is off is not checked, and notices it had queued are not sent.
* Open the actions menu (**⋯**) to **Edit** the rule or **Delete alert**. Deleting stops the rule straight away and also removes its entries from **Recent deliveries**. To keep the history, switch the rule off instead.

## Test a channel

**Send test** next to a channel sends a fixed message, **Test notification from CrispStats**, with an example fact. Nothing in it comes from your data. The test is queued and sent by the next run of the alerts job, usually within a minute, and the dashboard waits for the result:

* **Test sent to** the channel: the destination accepted it. A delivered test marks the channel as verified.
* **Test to** the channel **failed**: the reason is shown, such as a refused webhook URL or an error from the destination.
* **Test to** the channel **was not sent**: the delivery was skipped, with the reason.
* **Still queued**: the job has not picked it up within 90 seconds. It is still sent within a few minutes.

Owners, admins and members can send tests. The channel must be switched on. You can send one test per channel per minute, and 20 tests per workspace per hour.

## Delivery history

**Recent deliveries** lists the last 30 notices for the site, newest first. Each row shows the headline, the summary, when it fired, the rule, the channel and a status:

| Status | Meaning |
| - | - |
| **Sent** | The channel accepted the notice. |
| **Failed** | The channel refused it or did not answer. The error is shown next to it. |
| **Skipped** | Nothing was sent. A rule without channels is recorded here as skipped, so you still see that it fired. |

Turned-off channels are left out of a delivery. If none of a rule's channels is on, the notice is recorded as skipped. A request that gets a `429` or a `5xx` response is retried once. Timeouts and network errors are not retried, because the notice may have arrived and a duplicate is worse than a gap.

## Next steps

> [card] [Alert rule types](https://docs.crispstats.com/alerts/rule-types.md)
>
> Every rule, its threshold, windows and defaults.

> [card] [Channels](https://docs.crispstats.com/alerts/channels.md)
>
> Set up email, Slack, Discord, Telegram and webhooks.

> [card] [Monitor uptime](https://docs.crispstats.com/health/uptime.md)
>
> Create the monitors that Monitor down alerts watch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.