Generate comprehensive analysis reports from Mixpanel data with visualizations
Generate comprehensive Mixpanel reports (funnel, retention, dashboard, or custom) with visualizations and actionable insights. Use this when you need shareable analysis for stakeholders or deeper understanding of user behavior patterns.
/plugin marketplace add jaredmcfarland/mixpanel_data/plugin install mixpanel-data@mixpanel-datafunnel|retention|dashboard|customGenerate comprehensive, shareable reports from your Mixpanel analysis with visualizations, insights, and recommendations.
Verify credentials and data availability:
!$(mp auth test 2>&1 || echo "No credentials configured")
!$(mp inspect tables --format table 2>/dev/null || echo "No local data")
If credentials aren't configured, suggest running /mp-auth first.
Based on $1 or ask user to choose:
Comprehensive conversion funnel report with drop-off analysis.
Determine data source:
Collect required information:
Run funnel query using /mp-funnel approach or direct commands.
Create a markdown report with:
# Funnel Analysis Report
**Generated**: <timestamp>
**Date Range**: <from> to <to>
**Funnel**: <funnel-name or event-sequence>
## Executive Summary
- **Overall Conversion Rate**: X%
- **Total Entrants**: N users
- **Final Converters**: M users
- **Biggest Drop-off**: Step X → Step Y (Z% drop)
## Funnel Steps
| Step | Event | Users | Drop-off from Previous | Conversion from Start |
|------|-------|-------|----------------------|----------------------|
| 1 | <event1> | 10,000 | - | 100% |
| 2 | <event2> | 4,500 | 55% | 45% |
| 3 | <event3> | 3,200 | 29% | 32% |
| 4 | <event4> | 2,400 | 25% | 24% |
## Visualization

## Analysis by Segment
### Top Performing Segments
- **Segment A**: X% conversion (Y% above average)
- **Segment B**: X% conversion (Y% above average)
### Underperforming Segments
- **Segment C**: X% conversion (Y% below average)
- **Segment D**: X% conversion (Y% below average)
## Key Insights
1. **High drop-off at Step X**: Z% of users abandon here
- Possible causes: [friction point, UX issue, pricing]
- Recommendation: [specific action]
2. **Segment variation**: Top segment converts at 2x rate of bottom
- Analysis: [what makes them different]
- Recommendation: [optimize for successful segment]
## Recommendations
### High Priority
1. [Action 1] - Expected impact: [estimate]
2. [Action 2] - Expected impact: [estimate]
### Medium Priority
3. [Action 3]
4. [Action 4]
## Appendix: Query Details
```sql
[Include the exact queries used]
Generated by Mixpanel Data Plugin
### 4. Generate Visualizations
Create funnel chart:
```python
import pandas as pd
import matplotlib.pyplot as plt
steps = ['<step1>', '<step2>', '<step3>', '<step4>']
users = [10000, 4500, 3200, 2400]
conversion_rates = [100, 45, 32, 24]
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 6))
# Funnel bar chart
colors = ['#4CAF50', '#8BC34A', '#CDDC39', '#FFEB3B']
ax1.barh(steps, users, color=colors)
ax1.set_xlabel('Number of Users')
ax1.set_title('Funnel: User Count by Step')
for i, (step, count) in enumerate(zip(steps, users)):
ax1.text(count, i, f' {count:,}', va='center')
# Conversion rate trend
ax2.plot(steps, conversion_rates, marker='o', linewidth=2, markersize=10, color='#2196F3')
ax2.set_ylabel('Conversion Rate (%)')
ax2.set_title('Conversion Rate Trend')
ax2.grid(True, alpha=0.3)
for i, (step, rate) in enumerate(zip(steps, conversion_rates)):
ax2.text(i, rate, f'{rate}%', ha='center', va='bottom')
plt.tight_layout()
plt.savefig('funnel_report.png', dpi=300)
print("Report visualization saved")
Write to file:
# Save as markdown
<report-content> > funnel_analysis_<date>.md
# Optional: Convert to PDF using pandoc
pandoc funnel_analysis_<date>.md -o funnel_analysis_<date>.pdf
Comprehensive cohort analysis with retention curves and behavior patterns.
Execute retention query using /mp-retention approach:
# Cohort & Retention Analysis Report
**Generated**: <timestamp>
**Analysis Period**: <from> to <to>
**Cohort Definition**: Users who <born-event>
**Retention Metric**: <return-event>
## Executive Summary
- **Cohorts Analyzed**: N cohorts
- **Total Users**: M users
- **Day 0 Retention**: X%
- **Week 1 Retention**: Y%
- **Long-term Retention**: Z% (stabilized)
## Retention Curve

### Retention Benchmarks
| Metric | Your Product | Industry Benchmark | Status |
|--------|--------------|-------------------|---------|
| Day 0 | X% | 40-60% | ✅/⚠️/❌ |
| Week 1 | Y% | 25-40% | ✅/⚠️/❌ |
| Month 1 | Z% | 15-25% | ✅/⚠️/❌ |
## Cohort Comparison

### Best Performing Cohorts
1. **Week of <date>**: X% retention - [Analysis of what made this cohort successful]
2. **Week of <date>**: Y% retention
### Struggling Cohorts
1. **Week of <date>**: X% retention - [Analysis of challenges]
2. **Week of <date>**: Y% retention
## Retention Insights
### Positive Signals
- ✅ Retention curve flattens after week 4 (product-market fit indicator)
- ✅ Week 1 retention above industry average
- ✅ Recent cohorts showing improved retention
### Areas of Concern
- ⚠️ Steep drop-off in first week (onboarding opportunity)
- ⚠️ Cohort X underperforming (investigate cause)
- ⚠️ No improvement trend over time (need product changes)
## Recommendations
### Immediate Actions
1. **Improve Day 0-7 Experience**
- Current: X% retention
- Target: Y% retention
- Actions: [specific recommendations]
2. **Investigate Cohort X**
- Anomaly detected: Z% lower retention
- Possible causes: [hypotheses]
- Next steps: [analysis to run]
### Long-term Initiatives
3. [Strategy for improving long-term retention]
4. [Plan for cohort-based optimization]
## Appendix: Detailed Data
[Include cohort-by-cohort breakdown table]
---
*Generated by Mixpanel Data Plugin*
Create retention visualizations:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Retention curve
fig, axes = plt.subplots(2, 2, figsize=(16, 12))
# 1. Overall retention curve
intervals = list(range(12))
retention = [100, 48, 42, 38, 35, 33, 31, 30, 29, 28, 27, 27]
axes[0, 0].plot(intervals, retention, marker='o', linewidth=2, markersize=8)
axes[0, 0].set_title('Retention Curve')
axes[0, 0].set_xlabel('Weeks Since Cohort Birth')
axes[0, 0].set_ylabel('Retention Rate (%)')
axes[0, 0].grid(True, alpha=0.3)
# 2. Cohort heatmap (example data)
cohort_data = pd.DataFrame({
'cohort': ['Week 1', 'Week 2', 'Week 3', 'Week 4'],
'week_0': [100, 100, 100, 100],
'week_1': [45, 48, 52, 50],
'week_4': [30, 32, 35, 33],
'week_8': [25, 27, 30, 28]
})
cohort_pivot = cohort_data.set_index('cohort')
sns.heatmap(cohort_pivot, annot=True, fmt='.0f', cmap='RdYlGn', ax=axes[0, 1])
axes[0, 1].set_title('Cohort Retention Heatmap')
# 3. Cohort size comparison
cohorts = ['Week 1', 'Week 2', 'Week 3', 'Week 4']
sizes = [5000, 5200, 4800, 5100]
axes[1, 0].bar(cohorts, sizes, color='#2196F3')
axes[1, 0].set_title('Cohort Sizes')
axes[1, 0].set_ylabel('Users')
# 4. Week 1 retention trend
axes[1, 1].plot(cohorts, [45, 48, 52, 50], marker='o', linewidth=2)
axes[1, 1].set_title('Week 1 Retention Trend')
axes[1, 1].set_ylabel('Retention Rate (%)')
axes[1, 1].grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('cohort_report.png', dpi=300)
High-level overview for stakeholders with key metrics and trends.
Gather data for:
# Mixpanel Analytics Dashboard
**Report Period**: <from> to <to>
**Generated**: <timestamp>
## 🎯 Key Performance Indicators
| Metric | Current Value | Previous Period | Change | Status |
|--------|--------------|-----------------|---------|--------|
| **Active Users** | 12,450 | 11,200 | +11.2% | ✅ |
| **New Signups** | 2,340 | 2,100 | +11.4% | ✅ |
| **Week 1 Retention** | 42% | 38% | +4pp | ✅ |
| **Conversion Rate** | 24% | 22% | +2pp | ✅ |
| **Events/User** | 15.3 | 14.1 | +8.5% | ✅ |
## 📈 Growth Trends

### User Growth
- Total users: 125,000 (+15% vs. last period)
- Monthly active users (MAU): 45,000
- Daily active users (DAU): 12,450
- DAU/MAU ratio: 27.7% (healthy engagement)
## 🔄 Conversion Funnel

- **Sign Up → Activation**: 68% (-2pp vs. last period) ⚠️
- **Activation → First Action**: 45% (+3pp) ✅
- **First Action → Purchase**: 35% (stable) →
- **Overall Conversion**: 24% (+2pp) ✅
**Action Items**: Improve activation step to recover lost ground
## 💪 User Retention

- **Day 0**: 62% (+4pp) ✅
- **Week 1**: 42% (+4pp) ✅
- **Month 1**: 28% (+2pp) ✅
- **Stabilized**: 25% (healthy)
**Insight**: Recent product improvements showing positive impact on retention
## 🎨 User Segmentation
| Segment | Users | % of Total | Engagement | Conversion |
|---------|-------|-----------|------------|------------|
| Power Users | 3,500 | 7% | 45 events/user | 65% |
| Regular Users | 18,000 | 36% | 12 events/user | 28% |
| Casual Users | 28,500 | 57% | 3 events/user | 8% |
## 📊 Top Events (Last 30 Days)
1. **Page View**: 450,000 events
2. **Button Click**: 125,000 events
3. **Purchase**: 24,000 events
4. **Sign Up**: 12,000 events
5. **Share**: 8,500 events
## 🚀 Recommendations
### High Priority
1. **Improve Activation Rate**: Currently 68%, target 75%
- Hypothesis: Onboarding friction
- Action: A/B test simplified flow
2. **Convert Casual to Regular**: 28,500 users at risk
- Strategy: Engagement campaign targeting low-activity users
- Goal: Move 10% to regular tier
### Medium Priority
3. Expand power user features
4. Optimize purchase funnel for mobile
---
*Generated by Mixpanel Data Plugin*
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime, timedelta
fig, axes = plt.subplots(2, 3, figsize=(18, 12))
# 1. User growth trend
dates = pd.date_range(start='2024-01-01', periods=30, freq='D')
users = [10000 + i*500 + (i%7)*200 for i in range(30)]
axes[0, 0].plot(dates, users, linewidth=2, color='#2196F3')
axes[0, 0].set_title('Daily Active Users Trend')
axes[0, 0].grid(True, alpha=0.3)
axes[0, 0].tick_params(axis='x', rotation=45)
# 2. Funnel visualization
# [Similar to funnel report]
# 3. Retention curve
# [Similar to cohort report]
# 4. Segment distribution pie chart
segments = ['Power', 'Regular', 'Casual']
sizes = [3500, 18000, 28500]
axes[1, 0].pie(sizes, labels=segments, autopct='%1.1f%%', startangle=90)
axes[1, 0].set_title('User Segmentation')
# 5. Top events bar chart
events = ['Page View', 'Button Click', 'Purchase', 'Sign Up', 'Share']
counts = [450000, 125000, 24000, 12000, 8500]
axes[1, 1].barh(events, counts, color='#4CAF50')
axes[1, 1].set_title('Top Events (Last 30 Days)')
# 6. KPI summary
kpis = ['Active Users', 'Retention', 'Conversion', 'Engagement']
values = [12450, 42, 24, 15.3]
changes = [11.2, 4, 2, 8.5]
colors = ['g' if c > 0 else 'r' for c in changes]
axes[1, 2].bar(kpis, values, color=colors, alpha=0.7)
axes[1, 2].set_title('Key Metrics')
plt.tight_layout()
plt.savefig('dashboard.png', dpi=300)
Build a report based on user specifications.
Ask the user:
Based on requirements, combine:
Adapt the report structure to match requirements, including:
After generating any report:
# Create reports directory if needed
mkdir -p reports
# Save report
<report-content> > reports/<report-type>_<date>.md
Markdown to PDF:
pandoc reports/funnel_analysis.md -o reports/funnel_analysis.pdf
Markdown to HTML:
pandoc reports/cohort_report.md -o reports/cohort_report.html --self-contained
Include visualizations:
pandoc reports/dashboard.md -o reports/dashboard.pdf --include-in-header=<style.css>
Suggest sharing options:
After generating report:
Review and refine:
Share with stakeholders:
Take action:
Schedule next report:
"Missing data for report":
/mp-fetch to get necessary data"Visualizations not generating":
"Report too complex":