TL;DR
Cohort analysis for ecommerce groups customers by first purchase date and tracks what percentage return to buy again in month 1, month 2, month 3, and beyond. The output — a retention heatmap — reveals whether customer quality is improving, declining, or flat over time. This guide covers the three cohort types that matter (acquisition, behavioral, revenue), a six-step process to build your first table, retention benchmarks by category, and the specific actions operators take when cohort data reveals a problem.
What Is Cohort Analysis for Ecommerce?
A cohort is a group of customers who share a common starting event. In ecommerce, that event is almost always the first purchase date. Every customer who placed their first order in January 2025 belongs to the January 2025 cohort.
Cohort analysis tracks what happens to that group over time. Did 40% of January buyers return in February? Did 30% return in March? By month 6, what percentage of the original January cohort had made at least one more purchase?
The result is a table — rows are cohorts, columns are months since first purchase — that shows your brand's repeat purchase behavior in precise, comparable terms. Reading this table tells you whether your retention is improving or eroding, and which customer segments drive the most durable revenue.
The case for doing this rigorously: retained customers generate 3–5x more revenue per year than first-time buyers, and acquiring a new customer costs 5–7x more than retaining an existing one. A 5% improvement in retention can increase total revenue by 25–95% depending on the business model. These numbers only move if you can measure where the current baseline sits and which cohorts are underperforming.
Two brands, identical revenue growth, opposite retention trajectories. Only cohort analysis reveals the difference.
Three Types of Cohort Analysis That Matter for Ecommerce
Not all cohorts are equal. The three that operators use most — acquisition cohorts, behavioral cohorts, and revenue cohorts — answer different questions.
Acquisition Cohorts
The most common type. Group customers by their first purchase month and track repeat purchase rates over time. This answers: how well does the brand retain customers acquired in a given period? It catches macro-level retention shifts caused by changes in ad creative, product quality, or post-purchase experience.
Behavioral Cohorts
Group customers by what they did on their first order — the product category they bought, whether they used a discount code, which channel drove acquisition, or whether they subscribed to email at purchase. Behavioral cohorts answer: which actions or entry points correlate with higher long-term retention and LTV?
A brand may find that customers who buy a specific "hero product" first have 2x the month-3 retention of customers who buy a promotional item first. That is an actionable finding that changes which products get featured in acquisition campaigns.
Revenue Cohorts
Track revenue per customer over time, not just the count of returning customers. A cohort that retains 35% of customers but whose returning buyers spend half as much as the original order is less valuable than a 30% retention cohort whose returning buyers increase average order value. Revenue cohorts measure cumulative revenue per cohort member over time — the direct input to LTV calculation.
Step 1: Gather the Right Data
Pull every order record with customer identity and date
The minimum data set for cohort analysis is: customer ID, order date, order revenue. Everything else is optional enrichment.
The required fields for a basic acquisition cohort table:
| Field | Purpose in Cohort Analysis | Source |
|---|---|---|
| Customer ID | Links all orders to the same person | Shopify / order system |
| Order date | Determines cohort assignment and time-since-first-purchase | Shopify / order system |
| Order revenue | Required for revenue cohorts and LTV calculation | Shopify / order system |
| Acquisition channel | Required for channel-level cohort breakdown | UTM params / ad attribution |
| First order flag | Identifies cohort membership date | Derived from order history |
Guest checkout orders without customer IDs create gaps in cohort analysis. A customer who checked out as a guest on their first order cannot be linked to a later order even if they create an account. Brands with high guest checkout rates undercount retention — the actual repeat purchase rate may be materially higher than what the cohort data shows. Shopify's customer match logic can close some of this gap using email address matching.
Export the full order history. Do not limit to recent orders — cohort analysis requires longitudinal data. A 12-month history is the minimum for a meaningful cohort table. 24 months gives you enough cohorts to identify trends.