CRM & retention
Cohort Analysis for Online Shops: Track Repeat Buying by First-Purchase Month
Learn how to build a cohort table, calculate retention rates with worked examples, avoid the immature-cohort trap, and translate the numbers into timely winback actions for your online shop.
อ่านเป็นภาษาไทย
A concrete starting scenario
Imagine a fictional Thai online shop called Bloom Naturals that sells botanical skincare. The owner, Khun Aom, notices that her monthly revenue looks roughly stable — around 180,000 baht each month for the past six months. She feels reassured, until she exports her order history and realises that the same customers are not coming back. Each month's revenue is propped up almost entirely by newly acquired buyers, while earlier customers quietly stop reordering. A blended aggregate such as a repeat-customer share can hide this because it averages loyal early buyers together with high-churn newcomers into a single, deceptively stable number.
Cohort analysis is the tool Khun Aom needs. Instead of looking at all customers as one mass, it groups them by the calendar month of their very first purchase and then follows each group forward in time. Each group is called a cohort. The resulting table reveals not just how many people come back, but when they stop — and whether the shop is getting better or worse at keeping buyers over successive months. This guide explains how to build that table from scratch, read it correctly, and act on what it shows.
What a cohort is — and what it is not
A cohort, in this context, is every customer whose very first completed order falls within the same calendar month. That month is called Month 0, or the entry month. A customer who placed their first order in January and a second order in March belongs to the January cohort — their second order is observed activity within that cohort's history, not a reason to move them to a different cohort. Once assigned, a customer's cohort membership never changes.
The entry criterion is first order, not registration date, email sign-up, or site visit. Using a different trigger — say, the date someone subscribed to a newsletter — would produce a different and incomparable cohort. If your data export mixes 'account creation date' with 'first order date', you must choose one definition and apply it consistently. Switching definitions halfway through an analysis makes cohorts incomparable and the resulting numbers meaningless. Document your chosen definition before you start, and keep it stable across every report you produce.
Defining 'active': repeat purchases, not visits
For a non-subscription online shop, a customer counts as active in a given observation month if they place at least one additional purchase during that month. A site visit, a wishlist addition, or an email open does not count. This distinction matters because it anchors the metric to revenue-generating behaviour rather than passive engagement. If you later decide to change the definition — for example, to count loyalty point redemptions — you must rebuild all historical cohorts under the new rule before comparing them.
The observation month is indexed relative to the entry month, not to the calendar. Month 1 means the calendar month immediately after entry; Month 2 means two months after entry; and so on. A January cohort's Month 1 is February, Month 2 is March. A March cohort's Month 1 is April. This relative indexing is what lets you stack cohorts in a table and compare them side by side at the same stage of their lifecycle.
Month 0 (M0) is the entry baseline: it records the original cohort size — all customers whose first-ever order fell in that month. It is not a repeat-purchase retention cell. Because every cohort member is counted in M0 by definition, M0 always represents 100% of the cohort. Retention rates for subsequent months (M1, M2, …) measure the share of that fixed baseline who placed at least one additional order.
The retention rate formula with a worked example
The retention rate for any observation month in a cohort table is calculated with one formula: divide the number of active customers in that observation month by the original cohort size, then multiply by 100. Written out: Retention rate = (Active customers in observation month ÷ Original cohort size) × 100.
To make this concrete, suppose Bloom Naturals had 200 customers place their first-ever order in January (the January cohort). In February — Month 1 for that cohort — 60 of those 200 customers placed at least one additional order. In March — Month 2 — 34 of the original 200 returned. The calculation for Month 1 is (60 ÷ 200) × 100 = 30.0%. The calculation for Month 2 is (34 ÷ 200) × 100 = 17.0%. Note that the denominator stays fixed at 200 throughout — it is always the original cohort size, not the count from the previous month. Using the previous month's count instead would produce a different and less interpretable metric called a period-over-period rate, which answers a different question.
Two fields are required to reproduce each cell correctly: a unique customer identifier (so the same person is not counted twice if they place two orders in one month) and the order date (so you can assign each order to the correct observation month). A unique order identifier is additionally useful when your data export contains duplicate rows or line-item-level rows, because it lets you collapse multiple rows belonging to the same order before counting distinct customers. Omitting customer-level deduplication — counting order rows rather than distinct customers — inflates the active count and can produce retention rates above 100%, a clear signal that something is wrong in the calculation.
Building a three-cohort table: January, February, March
The following is a fully fictional teaching example. All customers, order counts, and percentages are invented for illustration only. They are not research results and should not be treated as benchmarks for any real shop or market.
Use one fictional extraction cutoff: the start of 15 April 2026 in Bangkok. January M3, February M2 and March M1 all refer to April, so all three are partially observed and carry an asterisk. January M1 and M2, and February M1, refer to completed February or March windows. A dash means that the relevant future month has not yet been observed; it is not zero retention. Compare only matching lifecycle months whose calendar windows have fully closed.
| Cohort (entry month) | Cohort size (M0) | M1 active customers | M1 retention % | M2 active customers | M2 retention % | M3 active customers | M3 retention % |
|---|---|---|---|---|---|---|---|
| January (fictional) | 200 | 60 | 30.0% | 34 | 17.0% | 22 * | 11.0% * |
| February (fictional) | 240 | 62 | 25.8% | 38 * | 15.8% * | — | — |
| March (fictional) | 180 | 41 * | 22.8% * | — | — | — | — |
Reading the table: what the numbers say and what they do not
For the January cohort, February M1 is 30% and March M2 is 17%, both over completed calendar months. April M3 currently shows 11% but is partial at the 15 April cutoff, so it cannot establish a further full-month decline. These are invented teaching values, not an industry threshold or a reason to label a customer permanently lost. M0 is a 100% membership baseline, not a repeat-purchase outcome.
The comparable completed M1 rates here are January's 30.0% in February and February's 25.8% in March. March's 22.8% is based on partial April and must be excluded from that comparison. Two completed points alone do not establish a sustained trend or its cause. Once more matching windows close, investigate possible differences in acquisition mix, products and seasonality rather than attributing a change to one intervention.
The dashes mark future windows that have not been observed. The asterisks mark partial April in January M3, February M2 and March M1. A partial value is an incomplete count, not a final monthly result or zero. Keep these distinctions visible when sharing the table, and exclude partial cells from comparisons with completed months.
The immature cohort problem: why recent cohorts cannot be fairly compared with older ones
At the same 15 April cutoff, January has two completed repeat-purchase periods after M0: February M1 and March M2. February has one: March M1. March has none yet: its April M1 is still partial. April is incomplete for every cohort, regardless of the lifecycle column it occupies. Older cohorts have more completed lifecycle months, but that does not make their current April cells complete.
A common mistake is to look at a recent cohort's early retention rate and conclude that it is stronger or weaker than an older cohort. Even if a recent cohort's early numbers look encouraging, you have no Month 3 or Month 6 data yet, so any such comparison is premature. Researchers and analysts sometimes describe this as censoring: the observation window cuts off before the cohort's story is complete. The correct practice is to compare cohorts only at matching, fully elapsed observation months — for example, comparing every cohort's completed Month 1 rate, or every cohort's completed Month 3 rate. Unreached periods should be left blank or marked '—'. Partially elapsed periods should either be excluded from comparisons or shown with a clear partial-data marker (such as an asterisk), as in the table above.
A customer whose first order was on 28 January is a full member of the January cohort. Even if a campaign on 25 January brings in 80 late-month first buyers, all belong in January's M0 baseline; their M1 is February. M0 is membership, so fewer days before January ends is not a reason to exclude or down-weight them. Calendar months do leave different elapsed times since first purchase. If the question is repeat buying within exactly 30 days of each first purchase, build a separate rolling-day measure and wait until every included customer has that full window. Do not mix that definition with the calendar-month table.
Fictional M1 values: January 30.0% and February 25.8% have completed windows; March 22.8% is partial April at the 15 April cutoff and is excluded from their comparison. The two completed points do not establish a sustained trend or a cause. Values are invented for teaching, not measured shop results.
Blended averages versus cohort rates: why the difference matters
A blended aggregate — such as a store-wide repeat-customer share — is a single percentage that merges customers at different stages of their relationship with the shop into one number. It looks clean and is easy to report to stakeholders, but it can obscure what is actually happening across individual customer groups.
A store-wide repeat-customer share of 18% would be a separate illustrative assumption, not a value calculated from this cohort table. Monthly cohort-active percentages cannot simply be averaged to reconstruct that share: the report period and distinct repeat customers must be defined from the underlying records. An aggregate may combine customers of different ages and acquisition mixes. Use the cohort view to inspect matching completed periods; neither the aggregate nor a partial newest cohort alone establishes deteriorating retention.
This masking effect becomes especially pronounced when a shop runs a large acquisition campaign. A flood of new first-time buyers raises the count of one-time buyers, pulling down an aggregate repeat-customer share even if all existing cohorts are performing identically to before. Cohort analysis holds the denominator constant for each group at its original size, so the signal for any given cohort is not distorted by acquisition volume in other months.
Sources: Shopify: Cohort Retention Analysis — How to Reduce Churn
Three additional cohort lenses beyond first-purchase month
Time-based acquisition cohorts — grouping by first-purchase month — are the foundation, but they are not the only lens available. The following three cohort types are the article's own analytical categorisation, drawn from widely used ecommerce practice, and are worth understanding for practical shop management.
Acquisition-channel cohorts group customers by where their first order originated: organic search, LINE advertising, TikTok campaigns, marketplace referral, or offline QR code. Comparing a 'TikTok Ads — January' cohort against an 'Organic Search — January' cohort at the same observation months reveals whether social-media-driven buyers return at similar rates to search-driven ones. If the TikTok group drops sharply after Month 1 while the organic group sustains reasonable rates through Month 3, that is evidence — though not proof — that the channel is attracting buyers who are primarily deal-sensitive rather than product-loyal. The word 'evidence' is deliberate: the same pattern could also reflect differences in the product promoted on each channel, the price point, or the audience demographic. More investigation is needed before changing budget allocation.
Behavioral cohorts group customers by a specific action they took, such as joining a loyalty program, using a referral link, or completing a product registration. A fictional example: if Bloom Naturals found that customers who scanned a product QR code to register their purchase showed a Month 2 retention rate of 28%, compared to 17% for customers who did not register, that difference would be worth investigating further. However, it is important to distinguish observed association from causal lift. Customers who bother to register may already be more engaged than average — the registration might not have caused the higher retention; both could reflect the same underlying trait. Controlled experiments are needed to establish causation.
Product cohorts group customers by the first product category they purchased. A skincare shop might compare customers who first bought a cleanser against those who first bought a serum. If cleanser-first buyers return at higher rates across every observation month, that suggests the cleanser creates a stronger usage habit or more natural cross-sell opportunities. Product cohort insight can feed into merchandising decisions — for example, giving the highest-converting entry product more prominence in paid acquisition creative.
Sources: Shopify: Cohort Retention Analysis — How to Reduce Churn
Estimating cohort churn for non-subscription shops
Subscription shops have a clear churn event: the customer cancels. Non-subscription shops do not. A customer could technically return after two years, so it is never possible to say with absolute certainty that someone has churned. The practical solution is to define a churn threshold based on your shop's own purchase behaviour.
An illustrative policy starts with the average gap between first and second orders among customers observed to buy at least twice. This describes observed repeaters, not a calibrated return probability for all customers. If that average is 45 days, a shop might choose 90 days (2 × 45) as a review threshold. For a cohort-level no-repeat-within-90-days proportion, count distinct original members without an eligible second order in their individual 90-day window; report it only when every included window is complete, or mark it partial. This is a chosen inactivity rule, not proof of permanent churn or a need for intervention, and it differs from the calendar-month cells above.
One published reference point from Shopify's ecommerce churn article — drawing on a DTC skin care scenario — suggests roughly 75% cohort churn is common for single-purchase businesses such as skin care or typical fashion brands; this is not a general benchmark for all non-subscription ecommerce. Separately, Shopify's enterprise retention guide cites a study of more than 156,000 DTC customers that found repeat purchase rates vary considerably by category: consumables can reach 22–44%, fashion tends to sit around 10–17%, and durables and home goods range from 7–18%. These figures are directional guides only and come from DTC datasets that may not reflect Thai market conditions, category mix, platform dynamics, or price points. Use your shop's actual order history to calculate your own interval and threshold rather than defaulting to a published number.
Sources: Shopify: Churn Rate in Ecommerce — Calculate and Reduce It · Shopify Enterprise: Ecommerce Customer Retention Strategies (2026)
How to build your first cohort table in practice
This manual process requires separately verified order history with a unique customer identifier and an order date for every eligible transaction. CasperBrain supports authorised customer CSV exports with permission-based field visibility. This guide does not specify those CSV columns or promise that a customer export provides transaction-level inputs. Obtain and validate the purchase-history source separately before constructing the table.
Step one: export your order data. You need at minimum: a unique customer identifier, and the order date. Without a customer identifier, you cannot link multiple orders to the same person. A unique order identifier is additionally valuable when your export contains duplicate rows or line-item-level rows, because it lets you collapse multiple rows belonging to the same order before counting distinct customers.
Step two: for each customer identifier, find the earliest order date. That date determines the customer's cohort. Group all customers whose earliest order falls in the same calendar month into the same cohort.
Step three: for each subsequent calendar month, count how many distinct customer identifiers from each cohort placed at least one order. Do not count order rows — count distinct customers. A customer who placed three orders in February contributes 1 to the February active count, not 3.
Step four: divide each active count by the original cohort size and multiply by 100. Enter the result into a grid where rows are cohorts and columns are observation months (M0, M1, M2, ...). Leave cells blank — or mark them '—' — for observation windows that have not yet been reached. For observation windows that have only partially elapsed, either exclude them from cross-cohort comparisons or mark them clearly with a partial-data indicator.
Step five: check your totals for sanity. M0 records the original cohort size and is the baseline (100%) for all subsequent retention calculations. Any observation-month cell above 100% means you have either double-counted customers or mixed up identifiers. Any cell that shows 0% for an early month when you would expect some activity is worth investigating for a filtering error.
Limitations, common errors, and what to do when the data is messy
Guest checkouts are a frequent problem. If a shop allows buyers to purchase without creating an account, the same physical person may appear as multiple distinct customer identifiers across orders. This artificially inflates cohort sizes and deflates retention rates, because the second order from the same person appears as a new customer rather than a repeat purchase. One mitigation is to match on email address across orders, though this fails when customers use different email addresses. Acknowledge this limitation in any report you share.
Cancelled and refunded orders should be excluded from cohort calculations, or at least treated consistently. If a customer's only order in Month 2 was subsequently fully refunded, counting that order as 'active' overstates retention. Define your inclusion rule — for example, 'only orders with a confirmed delivered or completed status' — before running the calculation.
Cohort sizes vary across months, sometimes dramatically. A shop that ran a major campaign in one month may have a cohort three times the size of surrounding months. Retention rates from a large cohort are statistically more stable than those from a small one — a 10-person cohort's 30% rate (3 customers) carries much more uncertainty than a 500-person cohort's 30% rate (150 customers). When cohort sizes differ significantly, be cautious about drawing strong conclusions from smaller groups.
Finally, do not act on a single month's data in isolation. A Month 1 retention rate that looks unusually high could reflect a mid-month campaign that pulled repeat buyers forward, rather than a genuine improvement in loyalty. Looking across multiple consecutive cohorts before concluding that something systematic has changed is good analytical practice; the number of cohorts needed depends on your typical cohort sizes, seasonality, and the magnitude of the apparent shift.
Translating cohort insight into action: timing winback and spotting friction
A low M1 value means few original members placed an eligible repeat order in that next calendar month. It does not mean they never repeated: some may have bought again in M0 or may return in M2. Use matching completed months to identify a question for follow-up, then inspect individual purchase timing. With an observed-repeater average of 45 days, a shop could test a permitted reminder around days 35–40 as an illustrative policy; those days are not an optimal contact time proved by the calendar-month table.
The form of the outreach depends on what you know about the customer. If they bought a cleanser and the product typically runs out in six weeks, a timely replenishment reminder is natural and useful. If they bought a one-time purchase item, a cross-sell to a complementary consumable is more appropriate than a replenishment prompt. Cohort analysis flags the timing; product and purchase history inform the message. Note that CasperBrain supports retention analysis and CSV export for planning purposes — any outreach execution, such as calls or messages, is a separate step handled by your team or a dedicated execution tool.
Cohort tables also help you spot friction points before they compound. If a cohort that was tracking at 20% in Month 1 suddenly shows only 8% in Month 2, while older cohorts showed 14–16% at the same stage, something changed between Month 1 and Month 2 for that group. Candidates include a product quality issue that affected a specific batch, a shipping delay during a particular period, or a price change that reduced perceived value. Investigating the issue while the cohort is still relatively young gives you the best chance of recovering those customers before they decide permanently not to return.
A growing library of consistently defined cohorts supports comparisons at matching completed lifecycle months. If packaging, fulfilment or a loyalty incentive changes, record it as a hypothesis alongside changes in acquisition, product mix and data coverage. Later cohort differences do not isolate that intervention's effect or guarantee improvement. A planned comparison is needed before attributing a change to a particular action.
Sources: Shopify: Cohort Retention Analysis — How to Reduce Churn
Sources and editorial method
Examples are fictional and contain no customer records. Prepared by the CasperBrain team with AI drafting assistance; facts and language are checked before publication.