Tag customers by recency, frequency and spend, and run win-back flows from the tags
Updated · By Ecomsellertool editorial team
To automate customer segmentation and win-back on Shopify, score every customer daily on days since their last order, number of orders and amount spent, place each one in exactly one segment (new, repeat, VIP, one-time, at-risk or lapsed), write one matching tag and let your email tool start the flow for that tag. Only subscribed customers get marketing email, and a person approves every discount and list change.
- Shopify segments filter customers by number of orders, amount spent, last order date, tags and email subscription status, and update automatically as customers meet or stop meeting the rules (checked November 27, 2026).
- Shopify's RFM analysis scores each customer 1 to 5 on recency, frequency and monetary value against the rest of your store and places them in 11 groups, such as Champions, At risk and Dormant.
- Shopify Flow's Customer joined segment and Customer left segment triggers can add or remove customer tags, and Shopify allows up to 250 tags per customer.
- Klaviyo's predictive analytics, such as churn risk, need at least 500 customers with orders, 180 days of order history with orders in the last 30 days, and some customers with 3+ orders.
- In this recipe every step is a fixed rule; no AI model decides who gets a discount, and a person approves every code, cap and suppression list.
The step map: who runs each step
Trigger: A daily run at a set time, after the day's orders and refunds have synced, plus each new order as it is paid.
| Step | What happens | Who runs it |
|---|---|---|
| 1 | Rules read every customer with at least one order: number of orders, total spent, first and last order dates, email marketing status and current tags. Test, staff and wholesale customers are skipped. | Rule |
| 2 | Rules place each customer in exactly one segment by reading the segment table top to bottom; the first row that matches wins. | Rule |
| 3 | Rules write the new segment tag, remove the old one, and log the customer ID, the old and new segment and the date. | Rule |
| 4 | Rules hold back from any discount step a customer with an open return, a refund under review or a chargeback, and send no marketing email to anyone not subscribed. | Rule |
| 5 | The email tool starts the flow for each new tag: onboarding, cross-sell, VIP early access or the win-back series. Steps without a discount send on their own. | Rule |
| 6 | A person approves the discount pool and its cap for each segment, every personal offer to a former VIP, and every change to the suppression or sunset list. | Person |
| 7 | Each week rules report customers per segment, moves between segments, orders from win-back flows, codes used and unsubscribes per flow. | Rule |
6 rule steps · 0 AI model steps · 1 person step. A rule follows fixed logic you approve; an AI model handles messy input and its output is checked by rules; a person makes the calls listed below.
What stays with a person
- The segment table itself: the day counts, order counts and spend lines, and any change to them
- Every discount: which segments may get one, the cap, and the code pool
- A personal win-back offer to a customer with a VIP history
- Moving customers to a sunset or suppression list, and deleting anyone from the email tool
- Exceptions: customers with open returns, chargebacks or complaints
Which tools can run it
- Shopify segments plus Shopify Flow (Customer joined segment and Customer left segment) writing the tags, with your email tool's own flows
- Your email tool's segments and flows on its own, with Shopify's order data synced in, when you do not need the tags in Shopify
- Zapier, Make or n8n with the segment table in a sheet, for a daily run across Shopify and another store or marketplace
- Custom code on your accounts, for several stores, large customer lists, an audit log and the weekly report
Systems it connects
- Shopify customers and orders
- Shopify Flow
- Email and SMS tool (Klaviyo or similar)
- Returns, helpdesk or chargeback records, for the holds
- Slack or email for the weekly report and approvals
Build size: Small
Shopify already holds every input; the work is agreeing the table, keeping one tag per customer and putting a person in front of every discount.
Most Shopify stores send the same email to everyone on the list. The customer who ordered yesterday, the one who has ordered nine times and the one who bought once two years ago all get the same sale. The data to tell them apart is already in Shopify: when each customer last ordered, how often and how much they spent. This recipe turns those three numbers into one tag per customer, refreshed every day, and lets your email tool start the right flow from each tag. A person still decides who gets a discount. It is one page of our automation library.
Which segments should each customer get, and what happens in each one?
Build this table before anything else. Each row is a segment, the rule that places a customer in it, the tag the workflow writes and what the tag starts. Read it top to bottom: the first row that matches wins, so every customer lands in exactly one segment. The rules use three numbers Shopify already stores for every customer: days since the last order (recency), the number of orders (frequency) and the total amount spent (monetary value). Every threshold here is our illustrative starting point, not a benchmark. Set your own from how often your products are bought.
| # | Segment | Rule (illustrative thresholds) | Tag written | Flow or action | Discount allowed? | Who approves |
|---|---|---|---|---|---|---|
| 0 | No orders yet | 0 orders | None | Your welcome series, outside this recipe | Your sign-up offer only | Marketing lead, once |
| 1 | New | 1 order, placed in the last 30 days | seg-new | Post-purchase onboarding: how to use it, what to order next | No | Marketing lead approves the flow once |
| 2 | VIP | 4 or more orders, $500 or more spent, last order within 90 days | seg-vip | VIP flow: thank-you, early access to launches, a review or referral ask | No code by default; perks such as early access or free shipping | Owner or marketing lead approves any VIP offer |
| 3 | Repeat | 2 or more orders, last order within 90 days, not VIP | seg-repeat | Cross-sell and replenishment reminders | No | Marketing lead approves the flow once |
| 4 | One-time | 1 order, placed 31 to 90 days ago | seg-one-time | Second-order nudge: best sellers, reviews, a product that pairs with the first | Yes, from a capped pool (for example 10% off, single use) in the last step only | Marketing lead approves the pool and cap |
| 5 | At-risk | Last order 91 to 180 days ago, any number of orders | seg-at-risk | Win-back series: a reminder first, new products second, an offer third | Yes, capped (for example 15%, single use, 14-day expiry) in the third step only | Marketing lead; a customer who ever spent $500 or more gets a personal offer the owner approves |
| 6 | Lapsed | Last order more than 180 days ago | seg-lapsed | One last win-back email, then the sunset rule: fewer sends, then suppression | Yes, one single-use code (for example 20%), once per customer | Owner approves the code and every suppression list change |
| H | Hold (applies on top of rows 1 to 6) | An open return, a refund under review, a chargeback, or a staff, test or wholesale account | Keeps its segment tag, plus seg-hold | No discount step and no win-back email until the hold clears | No | Support lead clears the hold |
| C | Consent gate (applies on top of every row) | Email marketing status is anything but subscribed | Keeps its segment tag | No marketing email; order and service emails only | No | Nobody overrides it |
Four choices keep the table safe. First, the order of the rows matters: VIP sits above Repeat, so a customer who qualifies for both gets the VIP tag, and a former VIP who stops ordering falls to At-risk or Lapsed on their own. Second, discounts live only in the late steps of rows 4 to 6, so a customer who comes back after a reminder never sees a code. Third, rows H and C run on top of every other row, so a customer in a dispute or without marketing consent is never emailed an offer. Fourth, the rows cover every customer with an order exactly once: under 30 days with one order is New, 2+ orders within 90 days is VIP or Repeat, one order at 31 to 90 days is One-time, then At-risk, then Lapsed.
How does the table score real customers?
As an illustration only (made-up customers, not client data), here is a daily run on November 27, 2026, against the table above.
| Customer | Last order | Days since last order | Orders | Spent | Average order | Segment and tag | What happens |
|---|---|---|---|---|---|---|---|
| A | Nov 10, 2026 | 17 | 1 | $48 | $48.00 | New, seg-new | Onboarding flow, no code |
| B | Oct 14, 2026 | 44 | 5 | $640 | $128.00 | VIP, seg-vip | Early access to the next launch, no code |
| C | Sep 8, 2026 | 80 | 3 | $210 | $70.00 | Repeat, seg-repeat | Replenishment reminder |
| D | Sep 20, 2026 | 68 | 1 | $65 | $65.00 | One-time, seg-one-time | Second-order nudge; D is not subscribed, so the consent gate stops the email and the tag is kept for reporting |
| E | Jul 1, 2026 | 149 | 6 | $820 | $136.67 | At-risk, seg-at-risk | Win-back series; spent over $500, so step three is a personal offer the owner approves |
| F | Mar 15, 2026 | 257 | 2 | $90 | $45.00 | Lapsed, seg-lapsed | One last win-back email, then the sunset rule |
Walk through two of them. Customer B has 5 orders (4 or more), $640 spent ($500 or more) and 44 days since the last order (within 90), so row 2 matches before row 3 is read. Customer E has the strongest history on the list, 6 orders and $820, but 149 days falls in row 5's 91 to 180 day band, so E is At-risk, not VIP. In this example a 15% code on E's average order of $136.67 would cost about $20.50 per order, which is why a person looks at E before the offer goes out.
Should you use Shopify's built-in RFM groups or your own tags?
Shopify already scores customers. Its RFM customer analysis gives each customer a score from 1 to 5 on recency, frequency and monetary value, where 5 means the top 20% of your store on that measure, and places them in 11 RFM groups such as Champions, Loyal, At risk, Previously loyal and Dormant (checked November 27, 2026). The group comes from the recency score and the average of the frequency and monetary scores, rounded down. The same page says scores come only from your store's own data and individual scores are not shown anywhere in the admin.
| Shopify RFM groups | Your own segment tags | |
|---|---|---|
| How the lines are set | Relative: each score is a fifth of your own customers | Fixed: the days, orders and dollars in your table |
| Can you explain why a customer is in a group? | Only the group shows; the 1 to 5 scores do not | Yes: the three numbers and the row that matched |
| Stable as the store grows? | Lines move as your customer base changes | Lines move only when a person changes the table |
| Where it can be used | Shopify segments, through the rfm_group filter | Shopify segments, Flow, discounts and any tool that reads Shopify tags |
| Best for | A quick first look at who is at risk | Flows and discounts with rules a person signed off |
Start with Shopify's groups to see the shape of your list, then write your own table. Shopify's segment filter reference lists an rfm_group filter with values such as CHAMPIONS, AT_RISK and DORMANT, and a predicted_spend_tier filter with HIGH, MEDIUM and LOW (checked November 27, 2026). Shopify's predicted spend tier page says it is only available once a store has made more than 100 sales. Both are useful checks on your own table: a customer your rules call Repeat but Shopify calls At risk is worth a look.
How do you keep the tags current every day?
In Shopify, build one segment per row. The same reference lists the filters each row needs: number_of_orders, amount_spent, first_order_date, last_order_date with date offsets such as -90d, customer_tags and email_subscription_status. Shopify's segment components page shows how they combine with AND, OR and brackets, for example number_of_orders >= 4 AND amount_spent >= 500 AND last_order_date >= -90d for row 2. Shopify adds and removes customers from a segment automatically as they meet or stop meeting its criteria, so the segment is always current; the tag is what carries it to other tools.
Shopify Flow writes the tags. A workflow that starts with Customer joined segment can run Add customer tags, and one that starts with Customer left segment can run Remove customer tags (checked November 27, 2026). Shopify's own template list for the joined trigger includes a "Win back customers" template that gives a discount to customers with no order in 60 days; in this recipe that discount step is replaced by an approval, as row 5 says. The Add customer tags page also warns that another app can overwrite a tag Flow just added, and suggests a Wait step when that happens.
Keep the tags tidy. Shopify's tags page allows up to 250 tags per customer, up to 255 characters each, says tags are not case sensitive and recommends letters, numbers and hyphens only (checked November 27, 2026). Use one prefix, such as seg-, remove the old segment tag in the same run that writes the new one, and never let a person hand-edit seg- tags. If you run the update on a schedule instead, Flow's Scheduled time trigger runs at most once every 10 minutes, and Get customer data returns up to 100 customers at a time, so a large list needs the segment triggers or custom code.
How does the email tool turn tags into VIP and win-back flows?
Your email tool does the sending; this recipe decides who is in which group. In Klaviyo, a segment is a dynamic group that grows as people meet its conditions and shrinks as they stop, updated in close to real time, and the condition "can receive email marketing" limits it to subscribers (checked November 27, 2026). Klaviyo's flows guide describes segment-triggered flows, where people enter when they are added to a segment, and notes that trigger filters are not checked again at send time, which is why each discount step should re-check the hold and consent rows with its own filter.
Get the Shopify data into the email tool first. Klaviyo's Shopify setup guide includes an option to sync Shopify email subscribers who accept marketing at checkout or sign up through a Shopify form, and warns that Shopify-synced profile properties, such as Shopify tags, are overwritten by the next sync if edited in Klaviyo (checked November 27, 2026). So the tag is changed in Shopify, never in the email tool. If you prefer to build the segments in the email tool alone, the same table still applies; the tags just stay out of Shopify.
Predictions can add a second opinion once you have enough history. Klaviyo's predictive analytics give churn risk, average time between orders and an expected date of next order, but need at least 500 customers who placed orders, 180 days of order history with orders in the last 30 days, and some customers with 3 or more orders (checked November 27, 2026). Use them to tune your day counts, not to replace the table: a person can explain a row, but not a churn score.
What stays with a person?
Every decision that spends margin or changes who hears from you. A person owns the table and signs off any change to it. A person approves the discount pool and cap per segment, checked against your contribution margin, and every personal offer to a customer with a VIP history. Shopify's amount off discounts can be limited to customer segments or specific customers and to one use per customer (checked November 27, 2026), so the approved code can only reach the segment it was made for. How to spot a code that leaks anyway is covered in our discount code leak alerts recipe. A person also approves every move to a sunset or suppression list, and any deletion request goes through our customer data deletion recipe instead.
Which tool should run it?
| Level | Fits when | What to watch |
|---|---|---|
| Shopify segments plus Shopify Flow, with your email tool's flows | One Shopify store, a few segments | One tag prefix, one workflow per joined and left trigger; apps that overwrite tags |
| Email tool segments and flows alone | You only need the groups for email and SMS | Tags never reach Shopify discounts or reports; keep the table in a shared doc anyway |
| Zapier, Make or n8n with the table in a sheet | Shopify plus another store or a marketplace | Log every run; a failed run must alert, not leave yesterday's tags in place. See our Zapier vs Make vs n8n comparison |
| Custom code on your accounts | Several stores, large lists, an audit log and the weekly report | The table, the tags and the log in one place; can run on Ecomsellertool Growth OS beside your order and reporting flows |
Our guide to what Shopify Flow automates covers the Flow basics, and what to automate first helps decide whether this beats your other manual jobs. Segments also feed two neighbor recipes: abandoned checkout follow-up for shoppers who did not finish, and back-in-stock notifications for customers waiting on a product.
Who builds customer segmentation and win-back automation?
Ecomsellertool builds workflow automation like this on your own Shopify, email and reporting accounts. We have built on Amazon's seller APIs since 2017 and shipped 50+ tools for 100+ teams. We write the segment table with you first, run it in report-only mode so you see who lands where, and switch on the flows only after you approve the discounts. Send a project brief, or read how our workflow automation service works.
The building blocks are work we have shipped:
- Tags that stay current. For Truskin, a skincare brand selling across several marketplaces, we built a reporting portal that refreshes the last 60 days of data because Amazon restates figures daily, and lets the team create and maintain dynamic tags on campaigns, such as branded, defense and conquesting. A segment tag needs the same discipline: rebuilt from fresh data on every run.
- Data split into groups people act on. For Lavley, a gifting brand, we built a sales analytics and goal-setting suite whose data segmentation lets the team analyze sales and set goals by brand and product type for units, gross revenue, net profit and net margin.
You keep your accounts, your data and the custom code we build; the Growth OS base is licensed to you.
Get your customer segments and win-back flows built
Send us your customer list setup and your email tool
Describe the workflow you want automated. We reply with a written plan: scope, timeline and a fixed price.
Frequently asked questions
What is RFM segmentation for an ecommerce store?
RFM stands for recency, frequency and monetary value: how many days since a customer's last order, how many orders they have placed and how much they have spent. Scoring customers on those three numbers splits them into groups such as new, repeat, VIP, at-risk and lapsed, so each group gets a different message instead of the whole list getting the same email.
Does Shopify have RFM segmentation built in?
Yes. Shopify's RFM customer analysis report scores each customer from 1 to 5 on recency, frequency and monetary value, compared with the rest of your store, and places them in 11 RFM groups such as Champions, Loyal, At risk and Dormant. You can filter a segment by RFM group with the rfm_group filter. Individual scores are not shown in the admin.
How do I automatically tag customers in Shopify by how much they spend?
Create one customer segment per tier with the amount_spent and number_of_orders filters, then build a Shopify Flow workflow that starts with Customer joined segment and runs Add customer tags, and a second that starts with Customer left segment and runs Remove customer tags. Use one tag prefix, such as seg-, so a customer carries one segment tag at a time.
How many days without an order makes a customer lapsed?
It depends on how often your products are bought. A coffee or supplement brand may call a customer at risk after 45 days, while a furniture brand may wait a year. Start from your own data: look at the typical days between first and second orders, set the at-risk line a little past it, and set lapsed at about twice that. The 90 and 180 days in this recipe are illustrative.
Should every win-back email include a discount?
No. Send a plain reminder or a new-product email first, and offer a discount only in a later step, only to segments where your rules allow it, and only within a cap a person has approved. Customers who learn that waiting brings a code will wait. Check the code against your contribution margin before it goes into the flow.
Can I send win-back emails to customers who never subscribed to marketing?
Treat them as not reachable by marketing email. Shopify records each customer's email subscription status, such as subscribed, not subscribed or unsubscribed, and you can filter on it. This recipe still writes their segment tag for reporting, but sends marketing email only to subscribed customers. This is not legal advice: check the email marketing rules for the countries you sell to with a qualified advisor.
