Skip to content

Cookbook: Send alerts to Slack

Set a webhook URL on a tracking campaign so iSearchFrom posts alerts to a small relay, which reformats them and forwards to a Slack channel.

Goal: when a tracking campaign raises an alert (a big ranking drop, a new competitor ad, a visibility change), have it appear in a Slack channel automatically.

  • A tracking campaign (position, ad, or AI-visibility) with alerts enabled.
  • A place to run a tiny relay — a serverless function (Cloudflare Workers, Vercel, AWS Lambda) or any small always-on endpoint.
  • A Slack incoming webhook URL for the target channel.

iSearchFrom delivers alerts as its own JSON payload (below). Slack’s incoming webhooks expect Slack’s format. A relay is a ~15-line function that receives iSearchFrom’s payload and reposts it to Slack as a readable message. It also keeps your Slack webhook URL private.

When an alert fires, iSearchFrom POSTs this to your campaign’s webhook URL:

{
"event": "tool.alert.created",
"timestamp": "2026-07-07T14:05:00.000Z",
"data": {
"alertId": "…",
"targetType": "position_campaign",
"campaignId": "…",
"campaignName": "Brand keywords — US",
"type": "…",
"severity": "…",
"metadata": { "…": "…" }
}
}

This Cloudflare Worker receives iSearchFrom’s payload and forwards a formatted message to Slack. The Slack webhook URL is stored as a secret, never exposed to iSearchFrom.

export default {
async fetch(request, env) {
if (request.method !== 'POST') return new Response('ok');
const { event, data } = await request.json();
if (event !== 'tool.alert.created') return new Response('ignored');
const text =
`:rotating_light: *${data.severity ?? 'alert'}* on *${data.campaignName}*\n` +
`Type: ${data.type} · Campaign: \`${data.campaignId}\``;
await fetch(env.SLACK_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text })
});
return new Response('ok'); // 2xx tells iSearchFrom the delivery succeeded
}
};

Deploy it and set the Slack webhook as a secret:

Terminal window
wrangler secret put SLACK_WEBHOOK_URL # paste your Slack incoming-webhook URL
wrangler deploy

You’ll get a public relay URL like https://serp-alerts.your-workers.dev.

Enable alerts on the campaign and set its alert webhook URL to your relay URL — in the app’s campaign alert settings, or via the campaign’s alertSettings when you create/update it through the API. See Schedules & alerts.

Cause an alert (or wait for the next run to raise one). iSearchFrom posts to your relay, which forwards to Slack.

  • A message appears in your Slack channel when an alert fires.
  • Your relay logs show a POST with event: "tool.alert.created" and returns 2xx.
  • If nothing arrives: confirm the campaign’s alert severity threshold is met, the webhook URL is correct and reachable, and your relay returns 2xx (non-2xx triggers retries, then gives up).
  • Rich Slack formatting — swap the { text } body for Slack Block Kit to include the metadata fields and a link back to the campaign.
  • Other destinations — the same relay pattern forwards to Microsoft Teams, Discord, PagerDuty, or an internal endpoint; just change the outbound fetch.
  • Filter noise — have the relay drop low-severity alerts or de-duplicate on alertId.