6 min read

What Is Cohort Exploration in Google Analytics 4

You know your overall retention rate, but you can't see which cohort of users is actually staying. Are early adopters more loyal than recent signups? Does a feature release improve retention for users who joined after launch? Cohort exploration in Google Analytics 4 answers these questions by grouping users based on when they started, then tracking how they behave in the weeks and months that follow.

Understanding Cohort Exploration

A cohort is a group of users who share something in common—usually when they first engaged with your product. Cohort exploration lets you compare behavior across these groups.

What makes a cohort

Cohorts group users based on first event date, first app open, first purchase date, or any custom dimension you define. In GA4, you'll see cohorts laid out in a table: rows are cohorts (grouped by signup date), columns are days/weeks after they started, and each cell shows how many users remained active.

javascript
// Tag users with their cohort date as a custom dimension
gtag('config', 'G-XXXXXXXXXX', {
  'user_properties': {
    'cohort_date': new Date().toISOString().split('T')[0],
    'signup_source': 'organic'
  }
});

// Or send it with a custom event
gtag('event', 'user_signup', {
  'cohort_date': new Date().toISOString().split('T')[0],
  'engagement_time_msec': 100
});
Set user properties to track cohort membership

Why cohorts matter

Aggregate metrics hide cohort effects. Your overall retention might be flat, but older cohorts could be declining while new cohorts are stable. Cohorts let you spot these trends and tie them to product changes.

Watch out: Cohort analysis only works if you have enough users. Small cohorts (under 100 users) show noisy retention curves.

Setting Up Cohort Exploration in GA4

GA4 makes cohort analysis available through the Explore tool in the web interface, and through the Data API if you need programmatic access.

Access the Explore tool

In GA4, go to Explore (left sidebar) and select Cohort Exploration. GA4 will automatically group users by their first event date by default.

Define your cohort dimension

Under Cohort Definition, choose what defines your cohort. The default is first event date, but you can also cohort by first purchase date, device category, or custom dimensions like subscription plan or signup source.

javascript
// Query cohorts programmatically using the Google Analytics Data API:
const {BetaAnalyticsDataClient} = require('@google-analytics/data');

const client = new BetaAnalyticsDataClient();

async function runCohortAnalysis(propertyId) {
  const response = await client.runReport({
    property: `properties/${propertyId}`,
    dateRanges: [
      {
        startDate: '2024-01-01',
        endDate: '2024-03-31'
      }
    ],
    dimensions: [
      {name: 'cohortDay'},
      {name: 'cohortNthDay'}
    ],
    metrics: [
      {name: 'activeUsers'},
      {name: 'retentionRate'}
    ],
    cohortSpec: {
      cohortDateRange: {
        startDate: '2024-01-01',
        endDate: '2024-01-31'
      },
      cohortDefinition: {
        dimensionName: 'firstSessionDate'
      }
    }
  });
  return response;
}

runCohortAnalysis('YOUR_PROPERTY_ID');
Query cohort data using the Google Analytics Data API

Select your retention metric

Choose what Active Users means for your cohort: daily active users (DAU), weekly active users (WAU), or monthly active users (MAU). This affects how the retention curve looks.

Tip: Use cohortNthDay (day 0, day 7, day 30) instead of calendar dates for easier pattern spotting across cohorts.

Reading Your Cohort Results

Cohort tables can look complex at first, but they tell a straightforward story: one row per cohort, one column per time period after signup.

Interpret the retention heatmap

Read across each row to see how a single cohort's retention decays over time. A cohort that stays bright green is sticky; one that fades to gray is leaking users. Compare rows to spot whether retention has improved over time (newer cohorts are stickier) or degraded (older cohorts were healthier).

javascript
// Process cohort data and calculate retention rates by time period
function analyzeRetentionTrend(cohortData) {
  const cohorts = cohortData.rows;
  
  cohorts.forEach(cohort => {
    const cohortDate = cohort.dimensionValues[0];
    const retentionDay1 = parseFloat(cohort.metricValues[0].value);
    const retentionDay7 = parseFloat(cohort.metricValues[1].value);
    const retentionDay30 = parseFloat(cohort.metricValues[2].value);
    
    console.log(`Cohort ${cohortDate}: Day1=${retentionDay1}%, Day7=${retentionDay7}%, Day30=${retentionDay30}%`);
  });
}

analyzeRetentionTrend(cohortAnalysisResult);
Extract and log retention rates from cohort results

Spot cohort effects tied to product changes

If retention dropped sharply in the cohort that signed up the week after you released a feature, you have data. If it improved, you have validation. Compare multiple cohorts to rule out noise.

Watch out: Don't compare retention rates across cohorts beyond day 30 without accounting for seasonality and churn plateaus. Most products see 80% of churn by day 30.

Common Pitfalls

  • Grouping by calendar date instead of cohort N-th day—this mixes actual age of the cohort with seasonality, making trends hard to spot.
  • Relying on retention for small cohorts (under 100 users)—random variation makes the signal unreliable.
  • Not controlling for external events—a feature launch or marketing campaign affects all cohorts, not just one.
  • Assuming cohort order is causal—older cohorts may just have had different marketing or product fit; correlation isn't proof.

Wrapping Up

Cohort exploration reveals whether your retention is stable, improving, or declining—and ties it to the cohort that experienced a product change. Armed with this, you can measure whether features actually stick. If you want to track cohort behavior automatically and compare retention across tools without manual GA4 analysis, Product Analyst can help.

Track these metrics automatically

Product Analyst connects to your stack and surfaces the insights that matter.

Try Product Analyst — Free