On a schedule
Get a weekly website report in Telegram
Every Monday a Telegram message compares last week's traffic, sources and top pages with the week before, with a short explanation.
- Runs
- On a schedule
- Apps
- Google Analytics, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- GA4 Viewer for service account; bot token
Send this to your assistant
Create a ClickRuntime automation: every Monday at 8am, compare last week's GA4 users, sessions, top sources and top pages with the week before, write a short summary with AI and send it to my Telegram, with a copy by email.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A founder running a small online business checks their phone first thing on Monday. They want to know how the website did last week, but GA4 on a phone is hard work and they rarely bother.
A short report in Telegram, written in plain words, gives them the week in a few seconds, wherever they are.
What you get out of it
The week in a few lines
Visitors, sources and top pages, with the change from the week before, in one message.
Read it on your phone
Telegram is quick to check; GA4 on a phone is not.
Explained, not just listed
AI says what moved and why it might have, so the numbers mean something.
A copy for your records
The same report is emailed to you, so you have a searchable archive.
How it works
What happens, step by step
Every Monday morning, ClickRuntime asks Google Analytics for last week's and the previous week's numbers.
It works out the change in users and sessions and lists the top sources and pages.
AI writes a short summary of what moved.
The report is sent to your Telegram chat, with a copy to your email.
Before it runs live
- Connect Google Analytics
- Connect Telegram
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 Slack
- Combine it with other Google Analytics and Telegram steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, http, credentials, ai, notify
CHAT_ID = "123456789"
def tg(method, **params):
r = http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=params)
return r.raise_for_status() or r.json()["result"]
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", [])
WEEKS = [{"startDate": "7daysAgo", "endDate": "yesterday"}, {"startDate": "14daysAgo", "endDate": "8daysAgo"}]
def top(dim):
rows = ga({"dateRanges": WEEKS, "dimensions": [{"name": dim}], "metrics": [{"name": "sessions"}],
"orderBys": [{"metric": {"metricName": "sessions"}, "desc": True}], "limit": 10})
return "\n".join(f"{r['dimensionValues'][0]['value']} [{r['dimensionValues'][1]['value']}]: {r['metricValues'][0]['value']}" for r in rows)
@on_trigger
def run(event):
totals = ga({"dateRanges": WEEKS, "metrics": [{"name": "totalUsers"}, {"name": "sessions"}]})
data = "Totals (users, sessions):\n" + "\n".join(", ".join(v["value"] for v in r["metricValues"]) for r in totals)
data += f"\n\nSources:\n{top('sessionSource')}\n\nPages:\n{top('pagePath')}"
report = ai.generate(data, system="date_range_0 is last week, date_range_1 the week before. Write a 8-line Telegram report: "
"totals with % change, top movers among sources and pages, one suggestion.", max_output_tokens=400).text
tg("sendMessage", chat_id=CHAT_ID, text=report)
notify.email_me("Website last week", report)
return {"sent": True}FAQ
Common questions
How long is the message?
Can I add conversions or revenue?
What day and time does it arrive?
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
Get a monthly search traffic report in Telegram
On the 1st of each month Telegram shows how your search traffic changed, with the landing pages that gained and lost the most.
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 weekly website report in Telegram” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.