Website Change Alerts to Google Chat: Incoming Webhook Relay
Post AyeWatch website change alerts to a Google Chat space: an incoming webhook, a signed relay with one thread per monitor, the Workspace requirement and the space rate limit.
By AyeWatch Team5 min read
Short answer: To post website change alerts to Google Chat, add an incoming webhook to a space and point AyeWatch's signed webhook at a relay that checks the signature and posts each alert as a Chat message, threaded by monitor. AyeWatch has no Google Chat app, and Chat's webhook expects its own JSON. Webhooks need a paid plan.
Before you start
Google's docs list incoming webhooks for Business and Enterprise Google Workspace accounts, and your organization's admin must allow them. A personal Gmail account cannot use them. Set the webhook up in Chat in a browser; Google says the mobile app cannot.
In the space, click the arrow next to the space title, then Apps & integrations, then Add webhooks. Give the webhook a name, save it, then use the More menu next to it to copy the link. It looks like this:
https://chat.googleapis.com/v1/spaces/SPACE_ID/messages?key=KEY&token=TOKEN
Treat the whole link as a secret, because the token in it lets anyone post to the space. Each link works only for the space it was created in.
How the pieces fit
Chat's webhook takes a JSON body with a text field. AyeWatch sends its own fields, headline and content, and Chat has no way to check X-AyeWatch-Signature. A relay checks the signature and builds the message. A made-up alert from a competitor pricing monitor:
{
"topic_id": 9066,
"topic_name": "https://larchboard.example/pricing",
"update_id": 145598,
"headline": "Larchboard drops its Starter plan and raises Business to $24 per user",
"content": "The pricing page no longer lists the Starter plan. Business is now $24 per user per month, up from $20, and adds single sign-on.",
"created_at": "2026-12-07T17:04:00Z",
"evidence": [
{ "quote": "Business $24 per user / month", "source_url": "https://larchboard.example/pricing" }
]
}
Sample rule: Alert me when Larchboard adds or removes a plan, changes a price or moves a feature between plans. Ignore logo and testimonial changes.
The relay
Store AYEWATCH_SECRET and the webhook link as CHAT_WEBHOOK_URL. SEEN is an optional KV namespace.
export default {
async fetch(request, env) {
// 1. Check X-AyeWatch-Signature against the raw request bytes.
const raw = await request.arrayBuffer();
const header = request.headers.get("x-ayewatch-signature") || "";
const hex = header.startsWith("sha256=") ? header.slice(7) : "";
if (!/^[0-9a-f]{64}$/i.test(hex)) return new Response("Bad signature", { status: 401 });
const sig = new Uint8Array(hex.match(/../g).map((h) => parseInt(h, 16)));
const key = await crypto.subtle.importKey(
"raw",
new TextEncoder().encode(env.AYEWATCH_SECRET),
{ name: "HMAC", hash: "SHA-256" },
false,
["verify"]
);
if (!(await crypto.subtle.verify("HMAC", key, sig, raw))) {
return new Response("Bad signature", { status: 401 });
}
// 2. Skip an update that was already delivered (SEEN is an optional KV namespace).
const e = JSON.parse(new TextDecoder().decode(raw));
const id = String(e.update_id);
if (env.SEEN && (await env.SEEN.get(id))) return new Response("Already sent");
const title = e.headline || e.topic_name;
const link = e.evidence && e.evidence[0] ? e.evidence[0].source_url : "";
// 3. Post to the space, with one thread per monitor.
const text =
"*" + title + "*\n" + (e.content || "").slice(0, 3000) + (link ? "\n" + link : "");
const res = await fetch(
env.CHAT_WEBHOOK_URL + "&messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD",
{
method: "POST",
headers: { "Content-Type": "application/json; charset=UTF-8" },
body: JSON.stringify({ text: text, thread: { threadKey: "ayewatch-" + e.topic_id } }),
}
);
const ok = res.ok;
if (!ok) return new Response("Destination refused", { status: 502 });
if (env.SEEN) await env.SEEN.put(id, "1", { expirationTtl: 1209600 });
return new Response("OK");
},
};
Google's threading docs pair a thread.threadKey in the body with the messageReplyOption query parameter. With REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD, the first alert from a monitor starts a thread and later ones reply in it, so each competitor gets one thread instead of a wall of separate messages. The link already holds a query string, so the relay adds the option with &. Chat formats *text* as bold and turns a plain URL into a link.
The rate limit and other routes
Google's quota for incoming webhooks is one request per second per space, shared by every webhook in that space. A burst from several monitors can get a 429. The relay answers 502 when that happens, and AyeWatch retries with exponential backoff, up to 10 attempts, so the alert lands a little later instead of getting lost.
Make, Zapier and n8n each have a Google Chat step if you prefer no code; put the signature check from the n8n guide or the Zapier guide in front of it. A Google Apps Script web app is a poor receiver: it answers a POST with a 302 redirect, which AyeWatch counts as a failed delivery, and its doPost cannot read the signature header.
What this setup won't do
- Work on personal Gmail. Incoming webhooks need a Business or Enterprise Workspace account.
- Send direct messages. A webhook posts to its space only.
- Read pages behind a login. AyeWatch reads public pages and cannot sign in.
- Beat the schedule. Checks run on a schedule: hourly on Pro, ASAP mode on Pro+.
Cost and a credit budget
Webhooks need a paid plan, trial included. AyeWatch Pro is $9/mo with 50 topics and hourly checks; Pro+ is $19/mo with 200 topics and ASAP mode. Every plan starts with a 7-day free trial.
A competitor space for two rivals:
- Two pricing monitors, each reading a rival's pricing, features and changelog pages, every 6 hours: 2 × 1 × 120 = 240 credits
- Two LinkedIn company posts monitors, daily: 2 × 2 × 30 = 120
Total: 360 credits a month, inside Pro's 500. Each alert posts once to the space, in its monitor's thread.
Google Chat alerts in six steps
- Check that your Workspace edition and admin settings allow incoming webhooks.
- In Chat in a browser, open the space, go to Apps & integrations, add a webhook and copy its link.
- Deploy the relay with the link as CHAT_WEBHOOK_URL and a placeholder secret.
- Open Notification settings, Webhook in AyeWatch, paste the relay URL and select Save Webhook. Reveal the signing secret and store it as
AYEWATCH_SECRET. - Create the monitors in AyeWatch with a rule for each.
- Wait for a real update and check that later alerts from the same monitor reply in its thread.
| AyeWatch field | Chat message part | Note |
|---|---|---|
| headline (or topic_name) | text, first line | Bold with *asterisks* |
| content | text, next lines | Cut at 3,000 characters |
| evidence[0].source_url | text, last line | Chat turns a plain URL into a link |
| topic_id | thread.threadKey | ayewatch-9066, one thread per monitor |
| update_id | Not sent | KV key that stops a retry from posting twice |
Start a monitor in under a minute
Describe a topic or paste a URL. Cancel before the trial ends and you pay nothing.
Try it free for 7 daysThe bottom line
Create a space for one competitor, deploy the relay and let the thread fill for a week. If the thread reads well, add the other rivals; each gets its own thread automatically.
FAQ
Can AyeWatch post to Google Chat directly?
No. AyeWatch sends a signed webhook with its own fields. A relay or an automation tool checks it and posts a message to the space's incoming webhook.
Do Google Chat incoming webhooks work with a personal Gmail account?
No. Google's docs list incoming webhooks for Business and Enterprise Google Workspace accounts, and the organization must allow them.
How do I keep each monitor's alerts in one Google Chat thread?
Send a thread.threadKey per monitor in the body and add messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD to the webhook URL.
What is the Google Chat incoming webhook rate limit?
Google's docs give one request per second per space, shared by every webhook in that space.
Can a Google Apps Script web app receive AyeWatch alerts?
Not reliably. It answers a POST with a 302 redirect, which AyeWatch counts as a failed delivery, and doPost cannot read the signature header.