Weekly
Log weekly Shopify sales to a sheet
Every Monday a new row in your sheet records last week's orders, revenue, average order value and top product.
- Runs
- Weekly
- Apps
- Google Sheets, Shopify
- AI
- Optional
- Access
- Shopify read_orders; Sheets write
Send this to your assistant
Create a ClickRuntime automation: every Monday, add a row to my Sales sheet with last week's Shopify order count, revenue, average order value and best-selling product.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A candle maker tracks the business in a Google Sheet: costs, wholesale orders and a weekly sales line they copy in from Shopify by hand. Some weeks get skipped, some numbers are typed wrong, and the trend chart has gaps.
Adding the weekly sales row automatically keeps the sheet complete and accurate. Charts, forecasts and conversations with a bookkeeper or investor all run on a record that has every week in it.
What you get out of it
No missing weeks
A row is added every Monday whether or not anyone remembers. Charts built on the sheet have no gaps.
Numbers match Shopify
Figures come straight from your store, so there are no typing mistakes. When someone asks where a number came from, the answer is simple.
Your sheet, your analysis
Once sales are in Sheets, you can combine them with costs, ad spend or wholesale orders. Shopify reports cannot do that on their own.
A short comment if you want one
AI can add a note on how the week compared with the one before. The sheet then reads like a diary of the business.
How it works
What happens, step by step
Every Monday, ClickRuntime collects last week's orders from your Shopify store.
It totals the orders and revenue, works out the average order value and finds the best-selling product.
AI can add a short note comparing the week with the previous one.
The figures are added as a new row in your Google Sheet.
Before it runs live
- Connect your Google Sheets account and pick the spreadsheets it may use
- Connect Shopify
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 Sheets and Shopify steps into one automation
Under the hood
The code that runs this automation
from datetime import date, timedelta
from collections import Counter
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, ai
STORE = "your-store.myshopify.com"
def gql(query, variables=None):
resp = http.post(f"https://{STORE}/admin/api/2025-07/graphql.json", json={"query": query, "variables": variables or {}},
headers={"X-Shopify-Access-Token": credentials.connection("shopify", "store")})
return resp.raise_for_status() or resp.json()["data"]
SHEET_ID = "your-spreadsheet-id"
@on_trigger
def run(event):
end = date.today() - timedelta(days=date.today().weekday())
q = f"created_at:>={end - timedelta(days=7)} created_at:<{end} -status:cancelled"
orders = gql("""query($q: String!) { orders(first: 250, query: $q) { nodes { totalPriceSet { shopMoney { amount } }
lineItems(first: 50) { nodes { title quantity } } } } }""", {"q": q})["orders"]["nodes"]
revenue = sum(float(o["totalPriceSet"]["shopMoney"]["amount"]) for o in orders)
top = Counter({li["title"]: 0 for o in orders for li in o["lineItems"]["nodes"]})
for o in orders:
top.update({li["title"]: li["quantity"] for li in o["lineItems"]["nodes"]})
best = top.most_common(1)[0][0] if top else ""
note = ""
try:
note = ai.generate(f"{len(orders)} orders, {revenue:.0f} revenue, best seller {best}", system="One short sentence for a sales log.", max_output_tokens=50).text
except (ai.AINotIncluded, ai.AILimitReached):
pass
sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
sheets.spreadsheets().values().append(spreadsheetId=SHEET_ID, range="Weekly sales!A:F", valueInputOption="USER_ENTERED",
body={"values": [[str(end - timedelta(days=7)), len(orders), round(revenue, 2), round(revenue / max(len(orders), 1), 2), best, note]]}).execute()
return {"orders": len(orders)}FAQ
Common questions
Can it log every order instead of weekly totals?
Which tab does it write to?
Does revenue include tax and shipping?
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
Draft blog posts from products, tracked in a sheet
Each week one product gets a blog draft in Shopify, and your content sheet records the title, date and link.
See how it worksPlan reorders from Shopify sales in a sheet
Each morning your Reorders sheet shows every product's stock, daily sales rate, days left and how many to reorder.
See how it worksLog late Shopify orders to a sheet
Every hour, paid orders that have missed your dispatch time are added to a sheet, and you get a Slack alert for each new one.
See how it worksKeep exploring
Set up “Log weekly Shopify sales to a sheet” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.