Cohort analysis
Cohort analysis is a way to follow groups of customers who started at the same time, such as one month's first-time buyers, and see how many buy again.
How it works
The store groups customers by the month of their first order. For each group, it counts how many ordered again one, two, three or more months later. The result is a triangle: one row per cohort, one column per month since the first order, and each newer cohort has one column fewer.
An average across all customers mixes those won years ago with those won last month. Older customers who keep buying can hold it steady while newer cohorts come back less often. A cohort table pulls the two apart.
Months differ too: a cohort won in a peak season sale can be a different mix of customers from one won in a quiet month. That is why a November cohort is different. The same table feeds customer lifetime value and churn rate.
Formula
Customers from the cohort who ordered in month N ÷ customers in the cohort
Where you see it
The Google Analytics 4 Data API groups users into cohorts by the date of their first session. It counts how many are active in each later day, week or month. It tracks users and activity, not customers and orders, so a cohort by first order comes from the store’s own order data.
Example
Example store, not client data.
| Cohort | New customers | Ordered in month 1 | Ordered in month 3 |
|---|---|---|---|
| January | 200 | 24 (12%) | 16 (8%) |
| April | 180 | 13 (7.2%) | 9 (5%) |
In month 1, 24 ÷ 200 = 12% of the January cohort ordered again, and 13 ÷ 180 = 7.2% of the April cohort.
Not to be confused with
- RFM segmentation — groups customers by how recently, how often and how much they buy, whenever they started. A cohort is fixed by its start date.
Right and wrong readings
- Wrong: “8% in month 3 means 8% of the January cohort have reordered by then.” Right: 24 customers, 12%, had already ordered in month 1. The month 3 column counts only customers who ordered in month 3 itself; a cumulative table is a different reading.
- Wrong: “A GA4 API cohort shows repeat buyers.” Right: it groups users by their first session and counts active users, so a visitor who comes back and buys nothing can still count.
Sources
- CohortSpec — GA4 Data API: cohorts by first session date, daily, weekly or monthly steps. Checked 2 October 2026.
- API dimensions and metrics — GA4 Data API: cohort active users. Checked 2 October 2026.