6 min read

How to Track Event Frequency in Mixpanel

Understanding how frequently users engage with features is critical for product decisions — it separates casual users from power users, and helps you spot drop-offs in usage patterns. Mixpanel makes this straightforward by letting you track event counts and frequency patterns through properties, then segment and analyze them in the UI.

Set Up Event Tracking with Frequency Properties

Start by installing the Mixpanel SDK and tracking events with properties that capture frequency data.

Install the Mixpanel JavaScript SDK

Add the Mixpanel SDK to your application. You can install it via npm or use the CDN. You'll need your project token from Settings > Project Token in the Mixpanel UI.

javascript
npm install mixpanel-browser

import mixpanel from 'mixpanel-browser';
mixpanel.init('YOUR_PROJECT_TOKEN');
Install and initialize Mixpanel with your project token

Track Events with a Frequency Count Property

When a user performs an action, track it with a property that captures how many times they've done it in a specific period. This gives you context for each event without creating extra database lookups.

javascript
const userFeatureCount = localStorage.getItem('feature_usage_count') || 0;
mixpanel.track('Feature Opened', {
  'feature_name': 'Dashboard',
  'usage_in_session': parseInt(userFeatureCount) + 1,
  'frequency_category': parseInt(userFeatureCount) > 5 ? 'power_user' : 'casual'
});
Track events with frequency properties to categorize user behavior

Use People Properties for Cumulative Frequency

Use people.increment() to maintain cumulative counts at the user level. This creates a user profile property that updates with each action, letting you track lifetime frequency without querying historical events.

javascript
mixpanel.people.increment('total_feature_opens', 1);
mixpanel.people.set_once('first_feature_open', new Date());
mixpanel.people.set('last_feature_open', new Date());
Maintain cumulative frequency counts as user properties
Watch out: User properties are updated asynchronously. If you need frequency data for immediate segmentation in the same request, include it as an event property instead.

Analyze Frequency Patterns in the Mixpanel UI

Once you're tracking frequency data, segment and visualize it using Mixpanel's analysis tools.

Segment Events by Frequency Properties

Go to Insights > Events, select your event, and use Segmentation to break down frequency by your custom property. This shows you how many users fall into each frequency category.

javascript
const response = await fetch('https://mixpanel.com/api/2.0/events/top', {
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
});
const data = await response.json();
Access segmentation data via the Mixpanel Events API

Create a Frequency Distribution with Funnels or Retention

Use Funnels to see if high-frequency users progress further than low-frequency users. Or use Retention to track whether frequent engagement predicts long-term retention.

javascript
mixpanel.track('Feature Opened', {'frequency_category': 'power_user'});
mixpanel.track('Action Completed', {'frequency_category': 'power_user'});
mixpanel.track('Upgrade Clicked', {'frequency_category': 'power_user'});
Include frequency categories in events to analyze conversion funnels by user type

Filter Users by Cumulative Frequency

In Cohorts, create a segment based on total_feature_opens (or whatever cumulative property you set). Filter for users where total_feature_opens > 10 to find power users, then export or trigger campaigns.

javascript
const response = await fetch('https://mixpanel.com/api/2.0/cohorts/list', {
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
});
const cohorts = await response.json();
Retrieve cohorts to identify and segment power users
Tip: Use Mixpanel's Retention report to correlate frequency with churn. Users with zero events in week 2 after high frequency in week 1 are at risk.

Export and Act on Frequency Data

Once you've identified frequency patterns, export the data or integrate it with your product.

Use the Data Export API for Custom Analysis

Export raw event data with frequency properties to your data warehouse or spreadsheet for deeper analysis. Use the Data Export API to pull events filtered by date range and properties.

javascript
const response = await fetch('https://data.mixpanel.com/api/2.0/export', {
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
});
const events = await response.json();
Export events filtered by frequency properties for custom analysis

Trigger Notifications Based on Frequency Thresholds

Use Mixpanel's Boards or webhooks to monitor frequency metrics and alert your team when specific thresholds are crossed (e.g., when a user's frequency drops unexpectedly).

javascript
if (previousFrequency > currentFrequency) {
  const payload = {
    'user_id': userId,
    'previous_frequency': previousFrequency,
    'current_frequency': currentFrequency,
    'alert_type': 'frequency_drop'
  };
  await fetch('https://your-api.com/webhook/user-churn-risk', {
    method: 'POST',
    body: JSON.stringify(payload)
  });
}
Trigger notifications when frequency patterns change
Watch out: The Raw Data Export API has rate limits. For high-volume exports, use Mixpanel's Scheduled Reports feature in the UI instead.

Common Pitfalls

  • Tracking frequency as an event property counts events but doesn't let you query cumulative frequency easily. Use people.increment() for persistent user-level counts.
  • Not including timestamp context: always track last_action_date or similar so you can tell if frequency is recent or stale.
  • Forgetting to initialize the SDK with your project token — this is the most common setup mistake and will silently fail.
  • Over-tracking raw counts in properties instead of categorizing into buckets (e.g., 'power_user' vs. 'casual'). Categories are easier to analyze and cheaper to store.

Wrapping Up

Tracking event frequency in Mixpanel reveals who your power users are, predicts churn, and guides feature prioritization. Start by capturing frequency properties in events, analyze them with Segmentation and Cohorts, then export for deeper analysis. If you want to track this automatically across 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