You're shipping a feature and need to know the moment something breaks. Custom Alerts in Mixpanel watch your metrics in real time and notify you when they cross a threshold or behave abnormally—so your team can respond before users complain.
What Custom Alerts Actually Do
Custom Alerts are conditional notifications that fire based on metric conditions you define.
Threshold vs. Anomaly Alerts
Threshold alerts fire when a metric exceeds or falls below a value you set (e.g., 'Daily Signups < 50'). Anomaly alerts fire when a metric deviates from its recent pattern—useful for catching unexpected dips without hardcoding thresholds. Pick the type that matches your KPI.
// Track the metrics that feed Custom Alerts
mixpanel.track('User Signup', {
'plan': 'pro',
'source': 'organic',
'timestamp': Date.now()
});
mixpanel.track('Feature Usage', {
'feature': 'export_report',
'duration_seconds': 45
});
// Mixpanel monitors these events and triggers alerts based on your configWhere Alerts Fire
Set up Custom Alerts in the Alerts tab of your Mixpanel project. Choose your metric, define the condition, and pick your notification channel: Email or a Slack webhook. When the condition is met, Mixpanel sends a notification immediately.
// Initialize Mixpanel with your project token
mixpanel.init('YOUR_PROJECT_TOKEN', {
'api_host': 'https://api.mixpanel.com'
});
// Set user identity for better segmentation
mixpanel.identify(user.id);
mixpanel.people.set({
'Email': user.email,
'Sign Up Date': new Date().toISOString(),
'Plan': 'premium'
});
// Events are now tagged to this user and monitored by alertsSetting Up Your First Alert
Walk through creating a threshold alert that fires when your key metric drops.
Choose Your Metric
Navigate to Alerts → Create Alert. Decide what to monitor: Daily Active Users, Conversion Rate, Revenue, or a custom event like 'Checkout Failed'. Mixpanel will offer different grouping options (by day, hour, minute).
// Track revenue events to monitor in alerts
mixpanel.track('Purchase', {
'revenue': 129.99,
'currency': 'USD',
'product_category': 'analytics',
'user_tier': 'enterprise'
});
// In Mixpanel UI: Create an Alert on the metric "Purchase" count or sum of revenueSet the Condition
Define when the alert fires. For threshold alerts: 'is greater than 500', 'is less than 100', 'increased by more than 25%'. For anomaly: 'deviates significantly'. Set the time window (last hour, day, week).
// Example: tracking a metric you want to alert on
const logConversion = (revenue, product) => {
mixpanel.track('Conversion', {
'revenue': revenue,
'product': product,
'timestamp': new Date().toISOString()
});
};
logConversion(299.99, 'enterprise-plan');
// In the Mixpanel UI, set an alert: "Sum of Conversion revenue < $10,000 per day"Connect Notifications
Add your email or Slack webhook. Click Send Test Notification to verify the integration works. Then save the alert. It's now live and will fire the next time your condition is met.
// Alerts are managed in the Mixpanel UI, but track alert context for auditing
mixpanel.track('Alert Context', {
'alert_name': 'Daily Revenue Threshold',
'condition': 'revenue < 10000',
'notification_channel': 'slack',
'created_at': new Date().toISOString()
}, () => {
console.log('Alert context tracked for audit');
});
// This lets you audit what triggered alerts in MixpanelReal Use Cases
Here's what teams monitor with Custom Alerts in production.
Catch Conversion Funnel Failures
Set a threshold alert on your checkout completion rate. If it drops 30% from average, your team gets a Slack notification immediately. This catches payment processor outages, broken redirects, or mobile bugs before support tickets flood in.
// Track funnel steps
mixpanel.track('Cart Viewed', { 'cart_items': 3 });
mixpanel.track('Checkout Started', { 'amount': 149.99 });
mixpanel.track('Payment Submitted', { 'payment_method': 'card' });
mixpanel.track('Order Confirmed', {
'order_id': 'ord_12345',
'revenue': 149.99
});
// In Mixpanel: Create a Funnel report, then Custom Alert on "Order Confirmed" step
// Alert: "Conversion rate < 15% (compared to 7-day average)"Monitor API Latency Spikes
If your API response time typically averages 200ms, set an anomaly alert. If it jumps to 2 seconds, something's degraded—database slowdown, traffic spike, or deployment issue. Your on-call engineer gets notified.
// Track API request performance
mixpanel.track('API Request', {
'endpoint': '/api/reports/export',
'status_code': 200,
'latency_ms': 245,
'user_tier': 'pro',
'timestamp': new Date().toISOString()
});
// In Mixpanel: Create Custom Alert on average latency_ms
// Alert type: Anomaly (detects unexpected jumps without hardcoding thresholds)Common Pitfalls
- Setting alert thresholds too aggressively causes noise. If your team ignores alerts because they fire constantly, you've set it wrong. Start with conservative thresholds (e.g., 50% drop) and tighten over time.
- Relying on anomaly alerts for low-volume metrics. Anomaly detection needs consistent historical data. If your metric is erratic, threshold alerts are more reliable.
- Forgetting to document the response. An alert without a runbook is useless. Clarify: who gets notified, and what do they do first?
- Creating global alerts that hide regional or cohort-specific issues. A dip in EU signups might be masked by US growth. Use Mixpanel's segmentation in alert conditions to isolate what matters.
Wrapping Up
Custom Alerts in Mixpanel turn your metrics into real-time notifications. By pairing threshold or anomaly conditions with email or Slack, you shift from reactive debugging to proactive incident response. Your team sees issues the moment they happen. If you want to track and alert on key metrics automatically across your entire analytics stack, Product Analyst can help.