6 min read

How to Track Retention Rate in Amplitude

Retention rate tells you what percentage of your users come back after their first interaction—and it's one of the most important health metrics for any product. Amplitude makes it easy to measure retention by cohort, segment, and time period using its built-in Retention analysis tool.

Set Up Events to Track User Behavior

Before you can measure retention, you need events that capture both initial and returning user actions.

Track the initial action that defines a cohort

This is usually a significant event like Sign Up or First Login. Send an event from your app whenever a user completes this action using the Amplitude JavaScript SDK.

javascript
import * as amplitude from '@amplitude/analytics-browser';

amplitude.init('YOUR_API_KEY');

amplitude.track('Sign Up', {
  signupSource: 'web_form',
  plan: 'free'
});
Initialize Amplitude and track a signup event

Track return actions that indicate ongoing engagement

Define what "returning" means for your product—it could be Login, Session Start, Dashboard View, or Feature Used. Track these events consistently so Amplitude can identify users who return.

javascript
amplitude.track('Session Start', {
  sessionDuration: 1800,
  deviceType: 'desktop'
});

amplitude.track('Feature Used', {
  featureName: 'export_data',
  duration: 45
});
Track return actions to measure engagement
Watch out: Don't track the same event for both signup and return actions. Use distinct event names so Amplitude differentiates your cohort-forming event from return events.

Build a Retention Analysis in Amplitude

Once your events flow into Amplitude, use the Retention analysis to visualize which users return and when.

Navigate to the Retention chart

In your Amplitude project, go to Analyze > Retention. This opens the retention builder where you'll define your cohort and return behavior.

Select your cohort-forming event

Under Cohort Definition, choose the event that creates your initial cohort—usually Sign Up or Install. Add filters to narrow it down by properties like country or signup source.

javascript
// Your frontend sends this event on signup
amplitude.track('Sign Up', {
  country: 'US',
  signupSource: 'organic',
  deviceType: 'mobile'
});

// In Amplitude UI, filter: country = 'US' AND signupSource = 'organic'
Event properties let you segment cohorts by user characteristics

Choose your return event

Under Return Event, select what action indicates the user is still active. For pure usage retention, choose Session Start. For feature-specific retention, pick Feature Used or Dashboard Opened.

Set your retention window

Select the time intervals—daily retention (returns within 1 day), weekly retention (returns within 7 days), or monthly retention (returns within 30 days). Amplitude shows you what percentage of your cohort returned in each window.

Tip: Use the breakdown dropdown to split retention by user properties like subscription plan or country. This reveals which segments have the strongest retention.

Interpret Results and Export Data

Once your retention chart is built, you can spot patterns and monitor them over time.

Read the retention table

Amplitude displays retention as percentages for each time bucket. The first column shows your cohort size; subsequent columns show what percentage was active in each period. A cohort that drops from 100% → 40% → 20% has serious drop-off after the second interval.

Save the chart to a dashboard

Click Save to Dashboard to add this chart to a monitoring dashboard. You can then check retention metrics regularly without rebuilding the analysis.

Export retention data via the HTTP API

Use the Amplitude HTTP API to pull retention data programmatically for reporting or alerting systems. The API accepts your event configuration and returns retention percentages.

javascript
const fetch = require('node-fetch');

const apiKey = 'YOUR_API_KEY';
const secretKey = 'YOUR_SECRET_KEY';

fetch('https://amplitude.com/api/2/retention', {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${Buffer.from(apiKey + ':' + secretKey).toString('base64')}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    event: 'Sign Up',
    returnEvent: 'Session Start',
    interval: 1,
    intervalUnit: 'day',
    buckets: 28
  })
})
.then(res => res.json())
.then(data => console.log('Retention:', data.retention));
Export retention data using Amplitude's REST API
Watch out: Never expose your secret key in client-side code. Use it only in backend services where it's secure.

Common Pitfalls

  • Using the wrong return event—if you track Page View on a single-page app, Amplitude might count users twice in the same session
  • Not filtering your cohort—bot traffic and test users artificially lower your retention numbers
  • Confusing N-day retention with Day N—1-day retention means users returned within 24 hours, not on day 1 specifically
  • Ignoring time zones—Amplitude uses UTC by default; users across regions may not align with your daily windows

Wrapping Up

You're now tracking retention in Amplitude and can see which cohorts are sticky, spot retention cliffs, and segment by properties to find what drives loyalty. If you want to track this automatically across tools and get unified retention metrics, Product Analyst can help.

Track these metrics automatically

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

Try Product Analyst — Free