Ecommerce Retention Analytics: How to Measure Customer Retention
How to measure ecommerce retention: repeat rate, time to second order, cohort retention curves, purchase cycles, drivers of repeat buying and fair comparisons.
Quick answer
Measure ecommerce retention at customer level from order history. Track the share of customers who place a second order, the median time to that order, and cohort retention curves showing how each acquisition cohort keeps buying over the following months. Choose windows that match your purchase cycle, exclude refunded and test orders, compare cohorts rather than blended averages, and segment by first product, channel and discount to find what's associated with customers coming back. Then test the actions those patterns suggest.
Retention Is a Measurement Problem First
Most ecommerce stores don't have subscriptions, so there's no cancellation event that tells you a customer has left. Retention has to be inferred from purchase behaviour, which makes definitions and windows central. A store selling coffee and a store selling mattresses will see very different repeat patterns, and neither is wrong. Retention analytics is about measuring your own pattern accurately, then seeing whether changes improve it.
This article covers measurement. For strategies to improve retention, see ecommerce customer retention and repeat purchases. For subscription-specific retention, see subscription ecommerce retention.
The Core Retention Metrics
| Metric | How to calculate | Why it matters |
|---|---|---|
| Second-order rate | Customers with 2+ orders ÷ customers acquired, within a window | The biggest drop-off in most stores |
| Time to second order | Median days from first to second order | Sets timing for follow-up |
| Repeat purchase rate | Share of customers with 2+ orders to date | Headline retention figure |
| Cohort retention | Share of a cohort ordering in each later period | Shows decline and plateau |
| Orders per retained customer | Orders ÷ customers with repeat orders | Depth of relationship |
| Returning customer revenue share | Revenue from customers with prior orders ÷ total | Dependence on acquisition |
Choosing Windows That Fit Your Purchase Cycle
Before measuring, find your natural purchase cycle. Take all customers with at least two orders and plot the distribution of days between first and second order. The median and the 75th percentile give you sensible windows. If most second orders arrive within 60 days, a 90-day second-order rate is informative. If they spread over a year, short windows will make retention look worse than it is.
Always compare like with like. A cohort acquired last month can't be compared with one acquired a year ago on repeat rate to date, because the older cohort has had more time. Use fixed windows (ordered again within 90 days of first order) so every cohort is judged over the same period.
with firsts as (
select customer_id, min(order_date) as first_date
from orders where status = 'paid' and not is_test
group by customer_id
)
select date_trunc('month', f.first_date) as cohort,
count(*) as customers,
avg(case when exists (
select 1 from orders o
where o.customer_id = f.customer_id
and o.order_date > f.first_date
and o.order_date <= f.first_date + interval '90 days'
and o.status = 'paid' and not o.fully_refunded
) then 1.0 else 0 end) as second_order_rate_90d
from firsts f
where f.first_date <= current_date - interval '90 days'
group by 1 order by 1;Cohort Retention Curves
A cohort retention curve plots, for each acquisition cohort, the share of customers ordering in month 1, 2, 3 and onwards after their first purchase. Curves usually fall sharply after the first order and then flatten. The shape matters: where the curve flattens shows the size of your loyal base, and how quickly it falls shows how many customers never return.
Read the table in two directions. Across a row, one cohort ages. Down a column, you compare cohorts at the same age. Improvements from a change (a better unboxing, a new loyalty programme, a different acquisition channel) show up as newer cohorts sitting higher at the same age. See ecommerce cohort analysis for building the table.
Finding What Is Associated With Retention
Once retention is measured, segment it. Compare second-order rates by first product category, first order value, discount used, acquisition channel, device, delivery speed, whether the first order had a return, and region. Patterns here generate hypotheses: customers acquired with deep discounts may return less often; customers whose first order arrived late may return less often; certain first products may lead to repeat buying of related items.
These are associations, not causes. Customers who bought a starter kit might return more because the kit suits committed buyers, not because the kit creates commitment. Use the patterns to decide what to test. See customer segmentation.
| Cut | Example question |
|---|---|
| First product category | Which first purchases lead to repeat orders? |
| Acquisition channel | Do some channels bring one-time buyers? |
| First-order discount | Do discount-led customers return at full price? |
| Delivery experience | Does late delivery reduce second orders? |
| Returns on first order | Does a return end the relationship or not? |
| Region and market | Does retention differ by market? |
Not sure whether your retention is improving?
ZSpace sets up cohort retention reporting from your order data, with definitions your team agrees on.
Retention and Value Together
Retention rate alone can mislead. A programme that brings back many low-value customers might look better on repeat rate than one that brings back fewer high-value customers. Track revenue retention alongside customer retention: the share of a cohort's first-period revenue that recurs in later periods, net of refunds. Link retention to customer lifetime value so improvements are judged on value, not headcount.
Measuring Retention Programmes
Retention tactics such as post-purchase email, loyalty points, replenishment reminders and win-back offers are often credited with every repeat order from customers who received them. Many of those customers would have returned anyway. The fair test is a holdout: randomly withhold the programme from a small group and compare repeat rates over the purchase cycle. The difference is the programme's effect.
Holdouts need enough customers and enough time. For small stores, a pre and post comparison of cohorts is weaker evidence but better than attributing all repeat orders to the programme. See personalization testing for holdout design and loyalty programme UX.
Retention Dashboards
- Second-order rate within a fixed window, by monthly cohort
- Median time to second order, trend over cohorts
- Cohort retention table (customers and revenue)
- Returning customer revenue share
- Retention by first product, channel and discount
- Holdout results for retention programmes
- Notes marking changes (new programme, pricing, fulfilment) on the timeline
Data Quality Checks
Retention figures are sensitive to data issues. Check that guest orders match to customers consistently, that test and staff orders are excluded, that refunds and cancellations are applied, and that marketplace or wholesale orders are separated if they behave differently. When a platform migration changes customer IDs, map old and new identities before comparing cohorts across the migration. See ecommerce customer analytics for building the customer table.
Worked Example
An illustrative scenario, not a client case: a skincare store's blended repeat rate looks stable, but a cohort table shows newer cohorts sitting lower at month three. Segmenting by channel shows the decline comes from customers acquired through a heavy first-order discount campaign. The team tests a smaller first-order incentive plus a sample of a complementary product, with a holdout, and compares second-order rates at 90 days. Decisions are made on the cohort comparison rather than the blended figure.
Retention by Category Purchase Cycle
Stores that sell across categories with different cycles should measure retention by category as well as overall. A customer who bought a winter coat isn't lapsed after three months; a customer who bought contact lens solution may be. Set windows per category using the same gap analysis, and track cross-category repeat purchases (a first order in one category followed by an order in another) separately, since that's often where growth comes from.
| Category type | Typical cycle pattern | Measurement approach |
|---|---|---|
| Consumables and replenishment | Short, regular | Customer-specific expected reorder dates |
| Fashion and apparel | Seasonal | Season-over-season retention |
| Home and furniture | Long, irregular | Longer windows, accessory and add-on orders |
| Electronics | Long for devices, short for accessories | Separate device and accessory retention |
| Gifts | Occasion-driven | Year-over-year occasion retention |
Leading Indicators of Retention
Retention results take a full purchase cycle to appear, which is slow for decision-making. Leading indicators give earlier signals: first-order delivery on time, first-order return rate, review submission, account creation, email engagement in the first weeks and product usage signals where available (such as a subscription's first skip). Track these for each cohort; if they move, retention often follows. Confirm the relationship in your own data before relying on it.
Retention Reporting on Shopify
Shopify analytics includes customer reports such as returning customer rate and customer cohort analysis, which cover common views without extra tools. For windows tied to your purchase cycle, revenue retention and segmentation by first product or channel, export orders or connect them to a warehouse. Keep the same definitions in both places so figures match. See Shopify analytics guide.
Common Mistakes
- Comparing young and old cohorts on repeat rate to date
- Windows that ignore the purchase cycle
- Counting refunded second orders as retention
- Crediting retention programmes with all repeat orders
- Reading associations as causes
- Tracking customer retention without revenue retention
Ready to measure retention properly?
Talk to ZSpace about retention and analytics audits, data pipelines and automated retention reporting.
Conclusion
Retention analytics starts with definitions: windows that fit the purchase cycle, clean order data and cohorts compared at the same age. Focus on the second order, segment to find patterns, pair customer retention with revenue retention, and use holdouts to measure programmes. Related: ecommerce churn analysis.
Common questions
The measurement of whether and when customers buy again: repeat purchase rate, time to second order, cohort retention curves, purchase frequency and the factors associated with repeat buying.