5 min read

How to Calculate Event Frequency in Amplitude

Event frequency answers a simple question: how often does a user actually do something? It's the difference between knowing someone visited and knowing they're actively using your product. Amplitude gives you multiple ways to calculate this—pick the one that fits your workflow.

View Frequency in the UI with Events Segmentation

The fastest path to seeing event frequency is right in Amplitude's dashboard.

Open Events Segmentation and select your event

Navigate to Analytics > Events Segmentation, then click Select event and pick the event you want to measure. Amplitude displays the total count over your date range.

javascript
// Track the event in your app first
amplitude.track('Feature_Used', {
  feature_name: 'Export',
  user_tier: 'pro'
});
Events tracked with the SDK appear in Events Segmentation

Switch to per-user breakdown to see the distribution

In the segmentation view, find the By user option in the breakdown dropdown. This shows you how many users performed the event 1 time, 2 times, 5 times, etc. The height of each bar is your frequency distribution.

javascript
// Example: if Events Segmentation shows 15 users with 3+ Feature_Used events,
// those are your power users. Frequency = 3 in this case.
const minFrequency = 3; // Minimum events to qualify as "power user"
const powerUserCount = 15; // From the segmentation graph
Interpreting the frequency distribution from the UI
Tip: Always set a date range first. Frequency over 7 days looks very different from 30 days. Most product teams care about the last 30 days.

Calculate Frequency with the REST API

For automated reports or dashboards, query the API to fetch event frequency data programmatically.

Use the User Search API to retrieve a user's events

Call the User Search API with a user_id. Amplitude returns the user's properties and recent events. You'll need your API key and secret key for Basic authentication.

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

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

const auth = Buffer.from(`${apiKey}:${secretKey}`).toString('base64');

fetch(`https://api.amplitude.com/api/2/usersearch?user_id=${userId}`, {
  headers: { 'Authorization': `Basic ${auth}` }
})
.then(res => res.json())
.then(data => console.log(data.events)); // Array of user's events
Fetch user event history via the User Search API

Filter and count the target event type

Loop through the returned events array and count how many match your target event type. This number is your frequency.

javascript
const events = [
  { event_type: 'Feature_Used', event_time: 1706793600 },
  { event_type: 'Feature_Used', event_time: 1706880000 },
  { event_type: 'Page_View', event_time: 1706966400 }
];

const frequency = events.filter(
  e => e.event_type === 'Feature_Used'
).length;

console.log('Feature_Used frequency:', frequency); // Output: 2
Count occurrences of a specific event type
Watch out: The User Search API caps results at 10,000 events per user. For users with extremely high event volume, you won't see the complete history. Use the Data Export API for comprehensive analysis.

Store Frequency as a User Property for Faster Segmentation

Instead of recalculating frequency every time, compute it once and save it as a user property. This makes segmentation instant.

Calculate frequency and set it as a user property

After you've counted the events, use setUserProperties() to store the frequency value on the user. This persists in Amplitude and can be used in cohorts and segmentation.

javascript
const calculatedFrequency = 42; // Example: user did something 42 times

amplitude.setUserProperties({
  'feature_usage_count': calculatedFrequency,
  'engagement_level': calculatedFrequency > 20 ? 'high' : 'low',
  'last_frequency_calc': new Date().toISOString()
});
Store frequency as a user property

Segment users by frequency in Cohorts

Now you can build a Cohort using the condition feature_usage_count > 20 to find your most engaged users. No calculation needed—it's a simple property lookup.

javascript
// Refresh frequency periodically (e.g., once per day via a backend job)
// This keeps the property current as events accumulate
function updateUserFrequency(userId, newFrequency) {
  amplitude.setUserProperties({
    'feature_usage_count': newFrequency,
    'last_update': Date.now()
  });
}
Periodic refresh pattern to keep frequency property current
Tip: Name properties consistently, like [event_name]_count or [event_name]_frequency. This makes them searchable and recognizable when you build cohorts later.

Common Pitfalls

  • Ignoring the time period—frequency without a date range is meaningless. Always specify: last 7 days? last 30 days? all-time? These give very different numbers.
  • Confusing total event count with unique user count—if 5 users each do an event twice, total frequency is 10, but only 5 users are involved.
  • Not accounting for API limits—User Search returns only 10,000 events per user. If you need complete frequency for high-volume users, use Data Export instead.
  • Updating user properties on every single event—this floods your API quota. Calculate frequency once per day, not per event.

Wrapping Up

Event frequency is your lens into who's actually using your product. Start with Events Segmentation for quick answers, move to the API for automation, and use user properties for fast cohort building. If you want to calculate and track event frequency automatically across all your tools, Product Analyst can help.

Track these metrics automatically

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

Try Product Analyst — Free