Skip to content

On a schedule

Log daily WooCommerce sales in a sheet

Each night the day's orders and revenue are added to a sheet and posted to Slack.

Runs
On a schedule
Apps
Google Sheets, WooCommerce
AI
Not needed
Access
WooCommerce read; Sheets write

Send this to your assistant

Create a ClickRuntime automation: every day at 11pm, total today's WooCommerce orders and revenue, add a row to my Daily Sales sheet, and post the numbers to #sales.

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

Shop owners want to know how today went without logging into the WooCommerce dashboard, and they want a history they can chart against ad spend or seasons. WooCommerce reports are fine for a quick look but awkward for building your own analysis.

Logging each day's totals to a sheet builds that history automatically, and the Slack post keeps the team aware of how the shop is doing.

What you get out of it

  • A sales history you own

    Every day is a row in your sheet, ready for charts, comparisons and forecasts.

  • The team sees the numbers

    A nightly Slack post keeps everyone aware of how sales are going, without dashboard access.

  • Compare with anything

    Put ad spend, weather or promotions next to the sales column and spot what moves the numbers.

  • Same numbers every night

    Totals are calculated the same way each day, so the record is consistent.

How it works

What happens, step by step

  1. Every night ClickRuntime fetches the day's paid orders from your store.

  2. It adds up the number of orders, revenue and average order value.

  3. A row with the date and totals is added to your sheet.

  4. The same numbers are posted to your Slack channel.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect WooCommerce

What you get

RunsOn a schedule
Log daily WooCommerce sales in a sheettoday, 9:00Succeeded
Slack · #sales🛒 Sun 19 Oct: 37 orders, £1,842.50 revenue (avg £49.80)

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 Google Sheets and WooCommerce 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.
daily_woocommerce_sales_snapshot_in_a_sheet.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from datetime import datetime
from zoneinfo import ZoneInfo
from clickruntime import on_trigger, credentials, http, notify

SHEET_ID, TZ = "your-spreadsheet-id", ZoneInfo("Europe/London")

STORE = "https://yourstore.com/wp-json/wc/v3"

def wc(method, path, **kw):
    resp = http.request(method, STORE + path, auth=(credentials.secret("WC_CONSUMER_KEY"), credentials.secret("WC_CONSUMER_SECRET")), **kw)
    resp.raise_for_status()
    return resp.json()

def sheets():
    return build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).spreadsheets().values()

@on_trigger
def run(event):
    today = datetime.now(TZ).date()
    start = datetime.combine(today, datetime.min.time(), TZ).isoformat()
    orders = wc("GET", "/orders", params={"after": start, "status": "processing,completed", "per_page": 100})
    revenue = sum(float(o["total"]) for o in orders)
    avg = revenue / len(orders) if orders else 0
    sheets().append(spreadsheetId=SHEET_ID, range="Daily!A:D", valueInputOption="RAW",
                    body={"values": [[today.isoformat(), len(orders), round(revenue, 2), round(avg, 2)]]}).execute()
    notify.slack(f"🛒 {today:%a %d %b}: {len(orders)} orders, £{revenue:,.2f} revenue (avg £{avg:,.2f})", channel="#sales")
    return {"orders": len(orders), "revenue": round(revenue, 2)}

FAQ

Common questions

Which orders are counted?
Orders marked Processing or Completed during the day, so failed and cancelled orders are left out.
Does it include refunds?
Refunds can be added as a separate column. By default, revenue is order totals before refunds.
Which time zone does the day use?
Your store's time zone, set when you create the automation.
What permissions does it need?
WooCommerce read; Sheets write. 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 (on a schedule). 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 “Log daily WooCommerce sales in a sheet” from your assistant

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