On a schedule
Post yesterday's Klaviyo revenue to Slack
Each morning Slack shows the revenue Klaviyo attributed to campaigns and flows yesterday, compared with the day before.
- Runs
- On a schedule
- Apps
- Klaviyo
- AI
- Not needed
- Access
- read (metrics, campaigns, flows)
Send this to your assistant
Create a ClickRuntime automation: every morning at 9am, post yesterday's Klaviyo-attributed revenue from campaigns and flows to #ecommerce in Slack, with the change from the day before.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Ecommerce owners and lifecycle marketers like to know whether yesterday's email and SMS efforts paid off, but the figure is buried inside Klaviyo's reporting. Logging in, picking the Placed Order metric and the right date range, then remembering what the number was the day before, adds up to a daily task that feels too small to bother with until a slump has been going on for a week.
Every morning, ClickRuntime looks up the Placed Order metric in your Klaviyo account, runs an aggregate that sums the order value for the previous day, and compares it with the day before that. It then posts the result to Slack, so the team starts the day with yesterday's revenue and whether it went up or down.
It is meant for teams who share one revenue number rather than each pulling their own.
What you get out of it
A bad day is noticed on the next morning
A broken flow, a paused campaign or a deliverability problem shows up as a drop in revenue. Seeing that drop at 8 a.m. gives you the chance to fix it before it costs another full day.
Everyone works from the same figure
When marketing, the founder and the operations lead each pull numbers on their own, they disagree on date ranges and filters. One automated post ends that, since every number is computed the same way.
Campaign effects are easy to connect
After a send, the next morning's post shows the revenue bump or the lack of one. That quick feedback helps you judge a subject line, an offer or a send time while the details are still in mind.
The day-over-day comparison adds context
A figure alone is hard to judge, since a $4,200 day might be great or poor. Including the previous day beside it tells people at a glance whether to celebrate or investigate.
Reporting costs nobody any time
Analysts and marketers spend minutes each day opening dashboards to answer the same question. Replacing that with a Slack post removes a small but constant interruption from the people who should be planning campaigns.
How it works
What happens, step by step
Every morning at 9 ClickRuntime asks Klaviyo for the order revenue it attributed to your campaigns and flows over the last two days.
It adds up yesterday's total and the day before's.
It works out the percentage change between the two days.
A message goes to your #ecommerce Slack channel with yesterday's revenue and the change, such as "+12% vs the day before".
Before it runs live
- Connect Klaviyo
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
- 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 Klaviyo steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify
API = "https://a.klaviyo.com/api"
def klaviyo():
return {"Authorization": f"Klaviyo-API-Key {credentials.secret('KLAVIYO_API_KEY')}",
"revision": "2024-10-15", "accept": "application/vnd.api+json", "content-type": "application/vnd.api+json"}
@on_trigger
def run(event):
h = klaviyo()
metric_id = next(m["id"] for m in http.get(f"{API}/metrics", headers=h).json()["data"]
if m["attributes"]["name"] == "Placed Order")
start, end = date.today() - timedelta(days=2), date.today()
body = {"data": {"type": "metric-aggregate", "attributes": {
"metric_id": metric_id, "measurements": ["sum_value"], "interval": "day", "timezone": "UTC",
"by": ["$attributed_channel"],
"filter": [f"greater-or-equal(datetime,{start}T00:00:00)", f"less-than(datetime,{end}T00:00:00)"]}}}
rows = http.post(f"{API}/metric-aggregates", json=body, headers=h).json()["data"]["attributes"]["data"]
before, yday = (sum(r["measurements"]["sum_value"][i] for r in rows) for i in (0, 1))
change = (yday - before) / before * 100 if before else 0
notify.slack(f"Klaviyo-attributed revenue yesterday: ${yday:,.2f} ({change:+.0f}% vs the day before)",
channel="#ecommerce")
return {"revenue": yday, "change_pct": round(change, 1)}FAQ
Common questions
What does Klaviyo-attributed revenue include?
Which time zone defines yesterday?
Could it post a weekly or monthly total as well?
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 weekly Klaviyo campaign report
Every Monday you see open rate, click rate and revenue for each campaign sent last week.
See how it worksGet warned when your list starts shrinking
You hear about it the day your main list loses profiles or unsubscribes run higher than usual.
See how it worksGet a weekly flow performance report
Each Monday your flows are ranked by revenue, with recipients and clicks.
See how it worksKeep exploring
Set up “Post yesterday's Klaviyo revenue to Slack” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.
