Alerts webhook
Alerts webhooks are triggered when anomalies are detected in your project. For more information, see Anomalies dectection.
Setting up Alerts webhooks
To set up an Alerts webhook:
POST /api/v1/webhooks
BODY: {
"url": "https://some-url.com",
"type": "alerts",
"secret": "some-secret" //optional
}
When an anomaly is triggered, you receive awebhook response with an alertType
. The table below contains all possibilities for alertType
and value
:
Alert type | Response type | Type | Value | Description |
---|---|---|---|---|
Anomaly threshold | eventThresholdAbsolute | event | eventsCount | Alerted if anomalies fall outside the predefined anomalies threshold |
Relative percentage change | eventThresholdRelative | event | eventsCount | Alerted if the conversion rate falls outside of the predefined percentage threshold |
Automatic detection | eventAutomatic | event | distance | Alerted when changes in the ratio of total event occurrences of daily visitors from the previous day compared to the average of the previous seven days falls out of the .95 confidence percentile (approximately: mean +/- 2* standard deviations) |
Anomaly threshold | funnelThresholdAbsolute | funnel | conversionRate | Alerted if anomalies fall outside the predefined anomalies threshold |
Relative percentage | funnelThresholdRelative | funnel | conversionRate | Alerted if the conversion rate falls outside of the predefined percentage threshold |
An example response:
{
"type": "alerts.<alertType>",
"timestamp": Date,
"project": {
"id": String,
"name": String
},
"organization": {
"id": String,
"name": String
},
"data": {
"target": {
"name": String,
"type": "event" | "funnel",
"id": String,
"url": String
},
"direction": String,
"threshold": Number,
"value": Number,
"date": Date
}
}
Updated over 1 year ago