Skip to content

Daily

Get a daily event count for each Segment source

Each morning you get yesterday's event volume per source, with any source down more than 20% called out.

Runs
Daily
Apps
Segment
AI
Not needed
Access
Public API token (Workspace Member read)

Send this to your assistant

Create a ClickRuntime automation: every morning at 7, email me yesterday's Segment event count for each source and flag any source that dropped more than 20% from the day before.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Event volume is one of the best signs that tracking still works. A mobile release breaks the signup event and the count drops by 40 percent. A website change removes a tag and a source goes silent. A bot floods another source and the count triples. In Segment, you only see this by opening each source's dashboard and comparing it to what you remember, so these shifts go unnoticed until reports look strange or a product manager asks why activation fell.

Each day the automation queries event volume for every source, compares it with the numbers stored from earlier days, and emails you a digest. Sources with a large change are flagged at the top. Data and analytics teams use it to start the morning knowing which sources need a closer look before they trust the dashboards built on them.

What you get out of it

  • Broken tracking found the day it breaks

    A source that drops sharply after a release is flagged the next morning. Fixing a missing event in a day saves weeks of unusable data in funnel and retention reports.

  • Spam and bot floods noticed

    A sudden surge in events from one source can mean bot traffic or a looping client. Seeing it early protects event-based billing and keeps analytics from being skewed by junk.

  • Dashboards can be trusted

    Analysts can check the digest before presenting numbers. If a source was flagged as unusual yesterday, they know to qualify a chart rather than present a drop as a real change in behavior.

  • A baseline for each source

    Stored history lets the digest say what is unusual for that source, instead of one fixed rule. A source with 2,000 events a day and one with 2 million are each compared with themselves.

  • Less time on routine checking

    Opening a dozen source dashboards daily is repetitive work. One email covers all of them, with only the exceptions highlighted, so the person responsible can start real analysis sooner. Opening twelve source pages each morning takes twenty minutes that an analyst could spend on a funnel.

How it works

What happens, step by step

  1. Every morning, ClickRuntime gets yesterday's event count for each of your Segment sources.

  2. It compares each count with the one saved from the day before.

  3. You get an email with every source's volume, and any source that fell by more than 20% is marked with a warning.

  4. Today's counts are saved for tomorrow's comparison.

Before it runs live

  • Connect Segment

What you get

RunsDaily
Get a daily event count for each Segment sourcetoday, 9:00Succeeded
Email · Segment events for 2026-10-18web_prod: 1,204,330 ios_app: 312,880 ⚠ down 27%

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Segment steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
source_event_volume_digest.pyexample
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, state, notify

@on_trigger
def run(event):
    day = date.today() - timedelta(days=1)
    resp = http.get("https://api.segmentapis.com/events/volume",
                    headers={"Authorization": f"Bearer {credentials.secret('SEGMENT_TOKEN')}"},
                    params={"granularity": "DAY", "groupBy": "source",
                            "startTime": f"{day}T00:00:00Z", "endTime": f"{day + timedelta(days=1)}T00:00:00Z"})
    resp.raise_for_status()
    counts = {r["source"]["id"]: r["total"] for r in resp.json()["data"]["result"]}
    before = state.get("counts") or {}
    lines = []
    for source, total in sorted(counts.items(), key=lambda kv: -kv[1]):
        prev = before.get(source)
        flag = "  ⚠ down {:.0%}".format(1 - total / prev) if prev and total < prev * 0.8 else ""
        lines.append(f"{source}: {total:,}{flag}")
    notify.email_me(f"Segment events for {day}", "\n".join(lines))
    state.set("counts", counts)
    return {"sources": len(counts)}

FAQ

Common questions

How does it decide that a change is big?
It compares each source with its own recent average and flags moves beyond a percentage you pick, such as 30 percent up or down. Small sources swing more in percentage terms, so a source with 200 daily events can be given a wider band than one with millions.
Does it show volume per event name or only per source?
The digest works per source by default. Segment can also report counts by event name, so it can list the events behind a change if you want more detail, at the cost of a longer email.
What happens on weekends when volume naturally drops?
Compare each day with the same weekday in earlier weeks, so a quiet Sunday is judged against other Sundays. Holidays still look unusual, so a flagged source on a bank holiday is worth a glance rather than an alarm bell.
What permissions does it need?
Public API token (Workspace Member read). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get a daily event count for each Segment source” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.