Ecommerce platforms15 min readUpdated October 14, 2026

How to Segment Customers in Ecommerce: A Step-by-Step Method

A 6-step method to segment ecommerce customers: the main types, RFM with a worked example, payment and subscription segments, Shopify and Klaviyo setup.

Article summary

TL;DR

To segment customers, start from one business question, pull the data that answers it (orders, checkout, subscription and payment events), write a rule that splits customers into groups, check each group is big enough to test, act on it, and measure against a holdout. RFM (recency, frequency, monetary value) is the usual first model.

  • A segment is a rule, not a list: customers enter and leave it as their data changes. Shopify and Klaviyo segments both work this way.
  • Start from the decision the segment will change. A segment that changes no message, offer or exclusion is a report, not a segment.
  • RFM scores each customer 1 to 5 on recency, frequency and spend. Shopify assigns 11 RFM groups automatically and lets you filter on them.
  • Payment segments matter as much as marketing ones: failed renewals, refunders and customers with an open dispute need different treatment, often an exclusion.
  • Small segments can't be tested. Check the size before you build a campaign, and keep a holdout to measure what the campaign actually changed.
Want to go further? AskChatGPTClaudePerplexityGrok
On this page

Segmenting customers means splitting them into groups that should be treated differently, then treating them differently. For an online store, the useful groups come from orders, checkout and subscription data, not from personas. This guide gives a six-step method, the main segmentation types, RFM with a worked example, the payment segments most guides skip, and how to build all of it in Shopify and Klaviyo.

What is customer segmentation?

Customer segmentation is dividing your customers into groups that share a trait or a behavior, so each group can get its own message, offer or exclusion. "Bought twice, nothing in 90 days" is a segment. So is "renewal failed this week" and "lives in Canada".

In current tools, a segment is a rule, not a list. Shopify describes its customer segments as "dynamic, rule-based customer lists": customers are added or removed automatically as they meet the criteria or stop meeting them.1Shopify Help Center, Customer segmentation Klaviyo says the same of its segments, which update "in close to real time", while its lists only grow when people subscribe or are added.5Klaviyo Help Center, Getting started with segments That matters: a CSV exported last month doesn't know who ordered, refunded or disputed since.

A segment has to change something

If you can't name the message, offer, price, channel or exclusion that changes for a group, it isn't a segment yet. It's a report. Write the action next to the rule before you build it.

How to segment customers in 6 steps

The method below works for a store with a few hundred customers and for one with a few hundred thousand. Only the tooling changes.

  1. Ask one question. "Which customers are about to stop buying?" or "Who should never get a discount?" One question, one decision.
  2. List the data that answers it. Usually orders, checkout events, subscription status and payment events. Check where each lives and how fresh it is.
  3. Write the rule. Plain conditions over fields and time windows: "2+ orders, last order more than 90 days ago, subscribed to email".
  4. Check the size. Count the customers who match. Too few to test means merge it with another segment or widen the window.
  5. Act. Attach one action to the segment: a flow, a campaign, an on-site offer, a customer list for ads, or an exclusion.
  6. Measure with a holdout. Keep a random share of the segment out of the action and compare orders and margin, not clicks.

Steps 4 and 6 are the ones most teams skip. They're also the ones that tell you whether the segment was worth building.

Step 1: start from a business question

The question decides which data you need and which method fits. Shopify's own guide to ecommerce segmentation recommends the same order: goal first, then data, then segments. The table pairs common store questions with a first segment and the metric that will judge it.

QuestionFirst segment to buildActionJudge it on
Who is about to stop buying?Repeat buyers past their usual reorder gapReminder, new product, reorder linkOrders vs holdout within 30 days
Who should never get a discount?Customers who buy at full priceExclude from promo campaignsMargin per customer
Which subscribers will churn without meaning to?Renewal failed, subscription still activeCard update request, retriesSubscriptions active 30 days later
Who should we stop advertising to?Active subscribers and buyers from the last 30 daysExclude from prospecting adsCost per new customer
Which first-time buyers will come back?First order in the last 14 daysOnboarding emails, then a review requestSecond-order rate
Who should we not market to at all right now?Open dispute or pending refundSuppress from all promotionsDisputes and complaints

Step 2: the data you need

Most store segments need four sources: the store or order system, the checkout, the subscription billing system, and the payment processor. Email and SMS engagement come from the messaging tool. What the customer told you (quiz answers, preferences) is zero-party data and usually lives in a form or survey tool.

Fig. 1What one customer looks like to a segment rule

Customer · Sam OrtizFirst order in February, 5 orders
Last order
64 days ago · $58
Orders and spend
5 orders · $312 total
Subscription
Monthly refill · renewal failed 2 days ago
Refunds and disputes
1 partial refund in March · no dispute
Email consent
Subscribed
Country
United States

Illustrative record.

each field comes from a different system

Illustrative record.

Before building on these fields, check three things:

  • One customer, one record. If the same person exists under two emails in the store and in the billing tool, their order count and recency are wrong everywhere. How records link together is covered in what CRM databases are.
  • Shared definitions. "Active subscriber", "churned" and "repeat buyer" must mean the same thing in every tool. Otherwise two segments with the same name hold different people.
  • Freshness. A payment segment that syncs once a day will email a customer about a failed renewal hours after they fixed it.

Types of customer segmentation

Most guides list four classic types: demographic, geographic, psychographic and behavioral. Ecommerce adds value-based segmentation, and stores with subscriptions need a sixth, built on payment and billing state.

TypeBased onEcommerce exampleBest forLimit
DemographicAge, gender, income, householdGift guide for parentsCreative and product positioningSays little about intent
GeographicCountry, region, climate, languageCurrency, shipping promise and local payment methods by countryPricing, delivery, payment options, timingSame country, very different buyers
PsychographicValues, lifestyle, motivations"Buys for performance" vs "buys for taste" from a quizMessaging and offersNeeds surveys or quizzes to collect
BehavioralViews, carts, orders, engagementAbandoned checkout, browsed a category twiceTriggered flows and on-site contentNeeds clean event tracking
Value-basedSpend, order count, recency, lifetime valueRFM groups, top 10% by 12-month spendWho gets VIP treatment, who gets discountsIgnores margin unless you add it
Payment and subscriptionRenewal status, failed payments, refunds, disputesRenewal failed, open disputeDunning, exclusions, retentionLives in the billing and payment tools

Behavioral segments get their own guide: what behavioral targeting is covers the signals, first-party data and the legal limits on profiling, including for health-adjacent products. Value-based and payment segments are where most stores get the fastest results, so the next two sections go deeper.

RFM segmentation explained

RFM is the standard way to segment by value using only order data. Every store already has the three inputs.

  1. Recency

    Days since the customer's last order. The fewer, the higher the score. Recent buyers are the most likely to buy again.

  2. Frequency

    Number of orders. A customer who ordered five times has a habit; a one-time buyer doesn't yet.

  3. Monetary value

    Total amount spent. Separates the customer who orders often at low value from the one who orders big.

Each dimension gets a score from 1 to 5, relative to your own customers. Shopify's method is a good reference because it's documented: a score of 5 means the customer is in the top 20% of that dimension for your store. Shopify then averages frequency and monetary into one FM score, rounded down, and places each customer in a group from R and FM.4Shopify Help Center, Customers reports (RFM customer analysis)

A worked RFM example

Take ten customers of a store, scored on October 1. With ten customers, each quintile holds two: the two most recent buyers get R = 5, the next two R = 4, and so on. Same for orders (F) and spend (M).

CustomerDays since last orderOrdersTotal spentRFMFM
A59$6405555
B126$4105444
C201$454111
D354$2604333
E482$903222
F703$1503333
G957$5202555
H1405$3302444
I2101$601111
J3002$751222

How the groups are assigned

Shopify's rules: Champions R = 5 and FM above 3. Loyal R 3 or 4 and FM above 3. Active R 4 or more and FM 2 or 3. New R = 5 and FM 1 or less. Promising R = 4 and FM 1 or less. Needs attention R = 3 and FM = 3. Almost lost R = 3 and FM 2 or less. At risk R 2 or less and FM 3 or 4. Previously loyal R 2 or less and FM above 4. Dormant R 2 or less and FM 2 or less. Prospects have no order.4Shopify Help Center, Customers reports (RFM customer analysis)

Applied to the ten customers, and with what to do for each group:

CustomerRFM groupWhat it meansWhat to doWhat not to do
A, BChampionsRecent, frequent, top spendersEarly access, referral program, ask for reviewsSend them your deepest discount
CPromisingRecent first order, low spendProduct education, replenishment reminderPush a subscription on day 2
DActiveRecent, some orders, moderate spendRecommendations from past purchases, loyalty programTreat them like new customers
EAlmost lostNot that recent, few ordersUseful content, a reason to come backSpend ad budget to win them back first
FNeeds attentionMiddling on every scoreOffer based on what they bought beforeLeave them in the general newsletter only
GPreviously loyalWas a top customer, gone quietNew products, personal win-back, ask whyIgnore them because recency is low
HAt riskStrong history, not recentPersonal outreach, an offer worth coming back forWait until they're Dormant
I, JDormantOld, rare, low spendNewsletter only, or let them goSpend on retargeting

The "what to do" column follows the goals Shopify gives for each group (move Promising and New to Active, Loyal to Champions, keep Champions as advocates).4Shopify Help Center, Customers reports (RFM customer analysis) The point of RFM is visible in G and H: by recency alone they look lost, but their history says they're the customers most worth a personal message.

RFM for subscription brands

RFM was built for repeat one-time purchases. With subscriptions, every renewal counts as an order, so a subscriber who never chose to buy again still scores high on frequency. Two fixes: compute RFM on one-time orders only and segment subscribers by subscription state instead, or keep RFM and always read it next to subscription status. A subscriber in "Champions" whose renewal just failed belongs in the payment segment below first. Lifetime value by customer is covered in what CLTV is.

Payment and subscription segments

Marketing guides rarely mention them, but billing and payment data produce some of the most important segments a store has. Most of them change what you should not send.

Stripe's subscription statuses are a good map. past_due means payment on the latest invoice failed or wasn't attempted; Stripe may retry while the subscription is in that state. unpaid means retries are over but the subscription still exists, and Stripe says to revoke access at that point. canceled is final.6Stripe Docs, How subscriptions work (subscription statuses) Your billing tool may use other names, but the states are the same.

  1. Renewal failed, subscription still active (past due)Involuntary churn risk. The customer didn't decide to leave; the card failed.Card update request and retries. No discount, no win-back copy.
  2. Retries exhausted (unpaid or canceled after failure)The subscription is lost unless the customer actsOne clear message with an update link, then a separate win-back later
  3. Card expiring next monthNext renewal will fail unless the card is updatedAsk for a new card before the renewal, not after
  4. Skipped or paused twice, support contact recentlyVoluntary churn riskPlan change, frequency change, a call from support
  5. Two or more refunds in 6 monthsProduct fit or quality problem, or refund abuseExclude from upsells and discounts; route to support
  6. Open disputeThe bank is deciding the payment. You can't refund it outside the dispute.Suppress from every promotion. Respond to the dispute, don't market to it.
  7. Dispute lost or customer blockedRecurring riskPermanent exclusion from marketing and from new subscriptions

The open-dispute row is a hard rule, not a preference. Stripe states that you can't issue a refund outside the dispute process while the dispute is open.7Stripe Docs, How disputes work A promotional email to that customer for the disputed product helps nobody. The retry and email sequence for failed renewals is covered in dunning and failed payment recovery and subscription payment failures; how to keep disputes from happening is in chargeback prevention.

A failed-payment message is not a marketing message

Keep the card update email about the card. Under US CAN-SPAM rules, adding a promotion and leading with it can turn a transactional message into a commercial one. The rules are summarized in behavioral targeting.

Inside Tagada

Build the funnel once, route every customer to the right offer

Checkout, upsells and subscriptions on one flow, with conditions per country, order or customer.

Start free

Segments vs cohorts

A cohort is a group defined by when customers started: everyone whose first order was in March, everyone who subscribed during a launch. A segment is defined by what is true about customers now. Both are useful; they answer different questions.

SegmentCohort
Defined byCurrent data (status, spend, recency)A start date or first event
MembershipChanges as customers changeFixed once the start date has passed
AnswersWho should get this message today?Are customers from March retaining better than from January?
ExampleRepeat buyers with no order in 90 daysCustomers whose first order was in March 2026
Used forCampaigns, flows, exclusionsRetention curves, LTV over time, testing what changed

The two work together: a cohort table shows that customers acquired through one campaign stop buying after the second order, and a segment then targets that group before the third. How to build and read a retention table is in what cohort analysis is.

Step 4: check the segment size before you act

A segment you can't measure is a guess. The number of customers you need depends on how often the outcome happens and how small a difference you want to detect. The chart shows how many customers you need in each group (targeted and holdout) to detect a 20 to 25% relative change in the conversion rate.

Fig. 2Customers needed per group to detect the change

  1. Base rate 2%, detect 2.5%13800
  2. Base rate 5%, detect 6%8200
  3. Base rate 10%, detect 12%3800
  4. Base rate 20%, detect 24%1700

Source: Two-proportion sample size calculation

rarer outcome, bigger segment needed

Standard two-proportion sample size, 95% confidence, 80% power. A calculation, not a benchmark: the change shown is what you want to be able to detect, not an expected result.

What this means in practice:

  • Rare outcomes need big segments. A win-back email that turns 2% of lapsed customers into buyers needs tens of thousands of customers in total to be measured. Most small stores can't test it per segment.
  • Merge segments that would get the same action. "At risk" and "Previously loyal" can share one win-back campaign and one holdout.
  • Widen the window instead of shrinking the segment. Run the test for longer, or measure a more frequent outcome (any order within 60 days rather than a specific product).
  • Some segments don't need a test. Exclusions (open dispute, unsubscribed) and service messages (failed renewal) are done because they're right, not because they lift revenue.

Steps 5 and 6: act, then measure with a holdout

Each segment gets one action and one holdout. The holdout is a random share of the segment that gets nothing. It's the only way to know what the campaign changed, because many customers in a segment would have bought anyway.

Fig. 3One segment, one action, one holdout

At risk customersR 2 or less, FM 3 or 4, subscribed to email
  1. Targeted groupGets the win-back sequence
  2. HoldoutRandom share, gets nothing from this campaign
  3. ResultOrders, revenue and margin per customer, both groups, same period

the comparison is between the two branches, never against last month

Illustrative split. The holdout share depends on segment size: large enough to measure, small enough not to cost much.

Three rules make the comparison honest:

  1. Split at random, before sending. Not "people who opened" versus "people who didn't".
  2. Compare orders and margin, not opens or clicks. Margin matters most for discount campaigns: a coupon that goes to people who would have bought at full price loses money while showing great conversion.
  3. Measure over the same period. Seasonality makes "this month vs last month" useless.

Where the action runs (email, SMS, on-site, ad audiences built from customer lists) and how automations use these segments is covered in commerce marketing automation.

How to build customer segments in Shopify

Shopify builds segments in the customer segment editor with a query language: you combine filter names, operators and values into a query.1Shopify Help Center, Customer segmentation Several filters are joined with AND (the customer must meet all of them) or OR (one is enough). Without brackets, AND is evaluated before OR, and Shopify recommends grouping filters with brackets.3Shopify Help Center, Components of a customer segment

-- At risk customers you can email
rfm_group = 'AT_RISK' AND email_subscription_status = 'SUBSCRIBED'

-- First-time buyers from the last 30 days
number_of_orders = 1 AND first_order_date >= -30d

-- Big spenders who have gone quiet
amount_spent > 500 AND last_order_date < -90d

-- Abandoned a checkout this week
abandoned_checkout_date >= -7d

-- Bought a tagged product in the last 3 months
products_purchased MATCHES (tag = 'refill', date BETWEEN -3m AND today)

-- Exclusion list kept with a customer tag
customer_tags CONTAINS 'dispute_open'

The filters worth knowing, all from Shopify's reference:2Shopify Help Center, Shopify-based customer segment filters

  • rfm_group takes Shopify's own RFM groups: 'CHAMPIONS', 'LOYAL', 'ACTIVE', 'NEW', 'PROMISING', 'NEEDS_ATTENTION', 'ALMOST_LOST', 'AT_RISK', 'PREVIOUSLY_LOYAL', 'DORMANT', 'PROSPECTS'. You get the RFM model without computing it.
  • predicted_spend_tier ('HIGH', 'MEDIUM', 'LOW') is only available once the store has made more than 100 sales.
  • email_subscription_status and sms_subscription_status keep consent in the rule itself. Put them in every marketing segment.
  • customer_tags is how data from other tools gets in. If your subscription app, helpdesk or payment tool tags customers (payment issue, dispute open), you can segment and exclude on that tag. Tags aren't case sensitive.
  • customer_countries uses two-letter ISO codes, for example customer_countries CONTAINS 'US'.

Shopify segments only know what Shopify knows. A failed renewal handled by a separate billing tool won't appear unless that tool writes it back as a tag or a metafield.

How to build customer segments in Klaviyo

Klaviyo segments are built from conditions, the most used being "What someone has done (or not done)", for example Placed Order a number of times over a period, and "Properties about someone".5Klaviyo Help Center, Getting started with segments Four details from Klaviyo's own help change how you build them:

  1. The default operator between conditions is OR. Switch to AND when every condition must be true. AND makes the segment stricter, OR more inclusive.
  2. OR with a negative condition can catch almost everyone, because each condition is checked separately. "Has not placed an order in 90 days OR has not opened an email" includes nearly the whole list.
  3. Segments don't require opt-in. A segment can contain people who never consented to marketing, so add a consent condition before sending a campaign to it.
  4. Snapshots freeze a segment. A snapshot creates a static list of the members at that moment; the segment itself keeps updating. Useful to keep the exact audience and holdout of a past test.5Klaviyo Help Center, Getting started with segments

Only top-level event properties can be used, and property values are case sensitive, so "payment_failed" and "Payment_Failed" are two different values.5Klaviyo Help Center, Getting started with segments Large segments can also take a while to populate, so build them before the day you plan to send.

One definition, several tools

When Shopify, Klaviyo and your billing tool all have a segment called "VIP", they rarely hold the same people. Write each segment rule once, in plain language, with its owner and refresh frequency, and rebuild it the same way in each tool.

Common customer segmentation mistakes

  1. Too many segments

    Every segment needs an action, an owner and a holdout. Thirty segments with the same email behind them is one segment with extra work. Start with a handful.

  2. Segments too small to test

    A segment of 300 customers can't show whether a campaign worked unless the effect is huge. Merge segments that get the same action, or measure a more frequent outcome.

  3. Stale data

    Weekly exports, payment events synced once a day, duplicates across tools. A segment is only as fresh as its slowest source.

  4. No exclusions

    Recent buyers in prospecting ads, subscribers getting first-order discounts, customers with an open dispute getting promotions. Exclusions are often the fastest win.

  5. Demographics only

    Age and gender are easy to collect and easy to present. They rarely tell you who will buy again or whose renewal will fail.

  6. Measuring with clicks

    Opens and clicks show attention, not what the segment changed. Compare orders and margin with a holdout.

Where Tagada fits

How Tagada helps

The checkout and subscription events behind your segments

Tagada runs the checkout (one-click upsells, order bumps, A/B tests, Apple Pay and Google Pay) and subscriptions (trials, billing cycles, dunning and automatic retries), and sends tracking server side to Meta, Google and TikTok. It works standalone, with Shopify, with WooCommerce or headless. Pricing is on the pricing page.

Whatever stack you use, the test is the same: can the tool that holds your orders, renewals, refunds and disputes pass those events to the place where you build segments, fast enough for a failed renewal to reach the right customer before the next retry?

Nick Bonnassies

CMO at Tagada

CMO at Tagada. Before Tagada, Nick built direct-to-consumer brands that generated over $115M in sales, raised over $25M in crowdfunding and sold two of them. He also works as a fractional CMO on marketing operations and AI systems.

Frequently asked questions

What are the 4 types of customer segmentation?

The four classic types are demographic (age, gender, income), geographic (country, region, climate), psychographic (values, lifestyle, motivations) and behavioral (what people view, buy and how often). Ecommerce guides often add value-based segmentation, which groups customers by what they are worth to the store, such as RFM or lifetime value bands.

How many customer segments should an ecommerce store start with?

Start with as many as you can act on and measure, usually a handful. Each segment needs its own message or exclusion, someone who owns it, and enough customers to compare against a holdout. Five well-used segments beat thirty that nobody maintains. Add a new one only when it changes a decision the existing ones can't.

What is RFM segmentation?

RFM scores each customer on recency (days since the last order), frequency (number of orders) and monetary value (total spent), usually from 1 to 5 relative to the rest of your customers. The scores are combined into named groups such as Champions, At risk or Dormant. Shopify calculates RFM groups automatically and exposes them as a segment filter.

What is the difference between customer segmentation and personalization?

Segmentation decides who belongs to which group. Personalization is what you do with that group: the email they receive, the products shown on the site, the offer at checkout. A segment with no personalized action behind it changes nothing, and personalization without a clear segment usually ends up as guesswork.

What is the difference between static and dynamic segments?

A dynamic segment is a rule evaluated against current data, so customers join and leave automatically. A static list is a snapshot frozen at the moment it was created. Shopify and Klaviyo segments are dynamic. Klaviyo can take a snapshot of a segment into a static list, for example to keep the exact audience of a past campaign.

How do you measure whether customer segmentation works?

Hold back a random share of the segment from the campaign and compare the two groups on orders, revenue and margin over the same period. Open and click rates don't prove anything: they don't show whether people would have bought anyway. If the targeted group doesn't beat the holdout, the segment or the action needs to change.

Sources

Checked October 14, 2026
  1. Shopify Help Center, Customer segmentation
  2. Shopify Help Center, Shopify-based customer segment filters
  3. Shopify Help Center, Components of a customer segment
  4. Shopify Help Center, Customers reports (RFM customer analysis)
  5. Klaviyo Help Center, Getting started with segments
  6. Stripe Docs, How subscriptions work (subscription statuses)
  7. Stripe Docs, How disputes work

Tagada

Checkout and subscription data you can segment on

Funnels, one-click upsells, subscription billing and payment routing, on one customer record.

  1. 01Create your free account
  2. 02Connect your store or build a checkout
  3. 03Launch funnels, upsells and subscriptions