5 min read

How to Set Up Alerts for Engagement Score in Mixpanel

You need to know when your users stop coming back, not weeks after it happens. Mixpanel's alerting system lets you watch engagement metrics in real-time and trigger notifications when something shifts. Here's exactly how to set it up.

Define and Track Engagement Events

Before you alert on engagement, you need to measure it. Engagement usually means active users, event frequency, or specific feature usage.

Step 1: Instrument Events That Signal Engagement

Start by tracking the actions that show a user is actually engaged. Use the Mixpanel JavaScript SDK to log events for key behaviors like feature use, time spent, or content interaction.

javascript
// Track engagement signals
mixpanel.track('Feature Interacted', {
  'feature_name': 'dashboard',
  'time_spent_seconds': 180,
  'user_tier': 'pro'
});

mixpanel.track('Report Generated', {
  'report_type': 'custom_analysis',
  'filters_applied': 5
});
Log the specific actions that define engaged users in your product

Step 2: Create a Retention or Cohort Metric

In Mixpanel, go to Insights and create a Retention chart or Segmentation view showing your engagement baseline. Retention shows what % of users return each day/week. Segmentation shows active user count over time. This is the metric you'll alert on.

javascript
// Query weekly active users via Mixpanel API
const startDate = '2026-03-19';
const endDate = '2026-03-26';
const projectToken = 'YOUR_PROJECT_TOKEN';

fetch(`https://mixpanel.com/api/2.0/events?project_id=${projectToken}&from_date=${startDate}&to_date=${endDate}`)
  .then(response => response.json())
  .then(data => {
    console.log('Weekly active users:', data.data);
  });
Query active user data from Mixpanel API to establish your engagement baseline
Tip: Start with one simple metric—weekly active users or daily login rate—then layer in more sophisticated engagement signals later. Avoid the trap of combining too many signals into one "score".

Create a Board and Set Up Alerts

Mixpanel's Board alerts let you watch dashboards and get notified when metrics cross thresholds. This is where engagement dips become actionable.

Step 1: Add Your Engagement Metric to a Board

Navigate to Boards in the left sidebar. Create a new board or open an existing one. Click Add insight and select your retention or segmentation chart. This visualizes the metric you want to alert on.

javascript
// Example: Set up a daily check for engagement
// Schedule this to run each morning
const checkEngagementScore = async () => {
  const response = await fetch(
    'https://mixpanel.com/api/2.0/retention?project_id=YOUR_PROJECT_ID',
    {
      method: 'GET',
      headers: {'Accept': 'application/json'}
    }
  );
  const data = await response.json();
  const todayRetention = data.data[data.data.length - 1];
  
  if (todayRetention < 0.25) { // Less than 25% retention
    console.warn('Engagement alert: retention dropped below threshold');
  }
};
Programmatically monitor your engagement metric using Mixpanel's REST API

Step 2: Configure the Alert Rule

Click the three-dot menu on your insight card and select Create alert. Set the condition: "alert if [metric] drops below [value]" or "increases above [value]." For engagement, you might use "alert if weekly retention drops below 30%" or "alert if active users fall below 1,000."

javascript
// Create a webhook alert for engagement drops
const alertConfig = {
  board_id: 'your_board_id',
  insight_id: 'your_insight_id',
  alert_name: 'Engagement Score Drop',
  condition: 'drops_below',
  threshold: 0.30,
  check_frequency: 'daily',
  notification_channels: ['slack', 'email']
};

// Webhook payload your server would receive
const exampleAlertPayload = {
  alert_id: 'alert_abc123',
  insight_name: 'Weekly Retention',
  current_value: 0.25,
  threshold: 0.30,
  triggered_at: '2026-03-26T14:30:00Z'
};
Define alert conditions and integrate with Slack or email notifications

Step 3: Connect Notifications

Choose your notification channel. Mixpanel supports Email, Slack, and webhooks. For Slack, use the Mixpanel app in your workspace's app directory, then select the channel that should receive alerts. For email, Mixpanel sends to the address on your account.

Watch out: Mixpanel checks board alerts once per day by default. If engagement swings rapidly intra-day, you'll miss it. For real-time monitoring, use webhooks routed to a service like PagerDuty or a custom Lambda that monitors more frequently.

Test and Maintain Your Alerts

Step 1: Test the Alert Flow

Temporarily set your alert threshold high so it triggers immediately. Verify the notification reaches your Slack channel or email inbox. Once confirmed, set the threshold to its real value. This ensures your notification pipeline is working before you rely on it.

javascript
// Log test events to verify alert trigger
mixpanel.track('test_engagement_event', {
  'is_test': true,
  'timestamp': Date.now()
});

// Example webhook receiver (Node.js)
const express = require('express');
const app = express();

app.post('/webhooks/mixpanel-alert', (req, res) => {
  const alert = req.body;
  console.log('Alert received:', alert);
  
  // Send to Slack or PagerDuty
  if (alert.current_value < alert.threshold) {
    notifyTeam(`Engagement dropped to ${alert.current_value}`);
  }
  res.status(200).send('OK');
});

app.listen(3000);
Test your alert pathway with low thresholds, then receive alerts via webhook in your backend

Step 2: Calibrate Thresholds Based on History

Look back 3–6 months of engagement data. What's your normal baseline? What's a 10% dip? A 30% dip? Set your alert threshold so it fires on dips that actually matter—not every minor fluctuation. A typical threshold might be "alert if weekly retention drops more than 15% from 30-day average."

Common Pitfalls

  • Alerting on raw event count—not all events signal engagement. Track quality metrics like retention, time spent, or feature-specific actions.
  • Setting thresholds without historical context—use past 6 weeks as baseline so alerts fire on meaningful changes, not noise.
  • Forgetting to exclude internal users—filter out your team's events in alert conditions using Mixpanel's property filters, or your thresholds will be skewed.
  • Relying on daily board alerts for urgent metrics—daily checks miss intraday drops. Use webhooks + a service like PagerDuty if you need real-time paging.

Wrapping Up

You're now catching engagement dips before they become revenue dips. Start with simple baselines—weekly active users or retention rate—then add precision as you learn. 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