Daily
Get a Slack alert when a page loses traffic
Each morning, Slack lists the pages whose traffic fell most compared with the previous 28 days, with a likely reason and a suggested fix.
- Runs
- Daily
- Apps
- Google Analytics, Slack
- AI
- Yes, uses the built-in AI allowance
- Access
- GA4 read; chat:write
Send this to your assistant
Create a ClickRuntime automation: every morning, compare each page's GA4 sessions over the last 7 days with the 28 days before. Post the pages that dropped by more than 30% to #seo with an AI note on the likely cause and what to check.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A publisher with hundreds of articles relies on a few dozen for most of its traffic. When one of them slips in search, or a link from a partner site disappears, nobody notices for weeks because overall traffic barely moves.
Checking every page daily and flagging the ones that are slipping lets the team fix a problem while it is still small.
What you get out of it
Slipping pages are caught early
A page losing traffic is flagged within days, not discovered in a quarterly review.
Hidden by the totals
Overall traffic can look fine while important pages fall; page-level checks find them.
A starting point for the fix
AI suggests what to check, such as a lost ranking, a broken link or an out-of-date page.
Only pages that matter
Pages with very little traffic are ignored, so the list stays short.
How it works
What happens, step by step
Every morning, ClickRuntime asks Google Analytics for sessions per page over the last 7 days and the 28 days before.
It compares each page's daily average across the two periods and skips low-traffic pages.
If no page dropped by more than 30%, nothing is posted.
Otherwise AI suggests a likely cause and what to check, and the list is posted to your #seo Slack channel.
Before it runs live
- Connect Google Analytics
- Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Google Sheets
- Combine it with other Google Analytics and Slack steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, http, credentials, ai, notify
PROPERTY = "123456789"
def ga(body):
url = f"https://analyticsdata.googleapis.com/v1beta/properties/{PROPERTY}:runReport"
return http.post(url, headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"}, json=body).json().get("rows", [])
@on_trigger
def run(event):
rows = ga({"dateRanges": [{"startDate": "7daysAgo", "endDate": "yesterday"}, {"startDate": "35daysAgo", "endDate": "8daysAgo"}],
"dimensions": [{"name": "pagePath"}], "metrics": [{"name": "sessions"}], "limit": 2000})
pages = {}
for r in rows:
p = pages.setdefault(r["dimensionValues"][0]["value"], [0, 0])
p[0 if r["dimensionValues"][1]["value"] == "date_range_0" else 1] = int(r["metricValues"][0]["value"])
drops = []
for page, (recent, before) in pages.items():
recent_avg, before_avg = recent / 7, before / 28
if before >= 50 and recent_avg < before_avg * 0.7:
drops.append(f"{page}: {recent_avg:.0f}/day vs {before_avg:.0f}/day ({(recent_avg - before_avg) / before_avg * 100:.0f}%)")
if not drops:
return {"drops": 0}
note = ai.generate("\n".join(drops[:20]), system="For these pages losing traffic, give the most likely cause and what to check, one line each.",
max_output_tokens=500).text
notify.slack(f"📉 Pages losing traffic\n{note}", channel="#seo")
return {"drops": len(drops)}FAQ
Common questions
Why compare 7 days with the previous 28?
Which pages are ignored?
Does it post every day?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Post a weekly website brief to Slack
Every Monday, Slack shows last week's visitors, conversions and top pages compared with the week before, with a short explanation.
See how it worksGet a daily news digest in Slack
Each morning your team gets a short summary of what's new on the sites and blogs you follow.
See how it worksFollow your stocks and crypto in Slack
During market hours you get a short update on the tickers you care about, with a heads-up on big moves.
See how it worksKeep exploring
Set up “Get a Slack alert when a page loses traffic” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.