Skip to content

Monthly

Sort customers into champions, loyal, at-risk and lost

Once a month you see which customers buy often and recently, and which have drifted away.

Runs
Monthly
Apps
WooCommerce
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: on the 1st of each month, score my WooCommerce customers on how recently they ordered, how often, and how much they spent, group them into champions, loyal, at-risk and lost, and email me the lists.

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

Most WooCommerce shops treat every customer the same, sending the same newsletter to someone who bought last week and someone who has not ordered in two years. The data to do better exists in the order history, but nobody has time to work out who buys recently, how often, and how much. The shop loses its best customers to quiet drift, and spends discounts on people who would have bought anyway.

Each month the automation pages through your orders and calculates three things for every customer: how recently they bought, how often, and how much they spent. It places each customer into a group such as champions, loyal, at risk or lost, and emails you the segments with counts and customer lists.

It is for shops that want to focus their marketing without buying a separate analytics tool.

What you get out of it

  • Know your best customers by name

    The champions list shows who buys often and spends well. A personal thank-you or early access to new products is cheap compared with losing them. Those people produce a large share of revenue in most shops, so small gestures return a lot.

  • Win back customers at risk

    People who used to buy regularly and have gone quiet are the most likely to respond to a reminder. Reaching them before they are fully lost costs far less than finding new buyers.

  • Stop discounting the wrong people

    Giving a coupon to a champion who would have bought anyway reduces margin. Segments let you reserve discounts for those who need persuading. Margin protected on repeat buyers is profit you do not have to earn again.

  • Measure loyalty over time

    Comparing the size of each segment month to month shows whether your customer base is getting more loyal or slowly drifting away. A shift in segment sizes is an early signal, long before revenue itself changes.

  • Better email lists

    Segments give you ready-made lists for different messages, so a newsletter, a win-back offer and a VIP note can each go to the right audience. Targeted messages also reduce unsubscribes from people who dislike irrelevant offers.

How it works

What happens, step by step

  1. Once a month, ClickRuntime goes through your WooCommerce orders.

  2. For each customer it works out how recently they bought, how often they order and how much they have spent.

  3. It sorts customers into champions, loyal, at-risk and lost.

  4. You get an email with each group's size and the customers in it, with their order count, total spend and days since their last order.

Before it runs live

  • Connect WooCommerce

What you get

RunsMonthly
Sort customers into champions, loyal, at-risk and losttoday, 9:00Succeeded
Email · Customer segmentsCHAMPIONS (42) orders@northwind.example: 7 orders, $1,284.00, last 12d ago

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 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.
rfm_customer_segmentation_report.pyexample
from collections import defaultdict
from datetime import datetime
from clickruntime import on_trigger, credentials, http, notify

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

@on_trigger
def run(event):
    auth = (credentials.secret("WC_CONSUMER_KEY"), credentials.secret("WC_CONSUMER_SECRET"))
    stats = defaultdict(lambda: {"last": None, "orders": 0, "spent": 0.0})
    page = 1
    while True:
        orders = http.get(f"{STORE}/orders", auth=auth,
                          params={"status": "completed", "per_page": 100, "page": page}).json()
        for o in orders:
            s = stats[o["billing"]["email"]]
            created = datetime.fromisoformat(o["date_created"])
            s["last"] = max(s["last"] or created, created)
            s["orders"] += 1
            s["spent"] += float(o["total"])
        if len(orders) < 100:
            break
        page += 1
    now, groups = datetime.now(), defaultdict(list)
    for email, s in stats.items():
        days = (now - s["last"]).days
        seg = ("champions" if days <= 30 and s["orders"] >= 3 else "loyal" if days <= 90
               else "at-risk" if days <= 180 else "lost")
        groups[seg].append(f"  {email}: {s['orders']} orders, ${s['spent']:,.2f}, last {days}d ago")
    body = "\n".join(f"{seg.upper()} ({len(groups[seg])})\n" + "\n".join(groups[seg])
                     for seg in ("champions", "loyal", "at-risk", "lost"))
    notify.email_me("Monthly customer segments", body)
    return {seg: len(v) for seg, v in groups.items()}

FAQ

Common questions

What do champions, loyal, at risk and lost mean?
Champions bought recently, often and spent the most. Loyal customers buy regularly. At risk customers used to buy but have not for a while, and lost customers have been quiet for a long time. A customer can move between groups from month to month.
How long does it take for a large store?
The automation pages through orders in batches, so a large history takes longer but works. It runs monthly in the background and emails you when it is done, so you do not need to wait.
Can I change what counts as recent?
Yes. The cut-off points between segments are set numbers, such as thirty or ninety days. A store selling consumables may want shorter periods than one selling furniture, and your AI assistant can adjust them. Those boundaries matter more than any other setting.
What permissions does it need?
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 (monthly). 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 “Sort customers into champions, loyal, at-risk and lost” from your assistant

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