|
| 1 | +--- |
| 2 | +sidebar_label: Migrate from Mixpanel |
| 3 | +title: Migrate your analytics data from Mixpanel |
| 4 | +keywords: |
| 5 | + - owner:Shubham |
| 6 | +last_update: |
| 7 | + date: 2025-10-07 |
| 8 | +--- |
| 9 | + |
| 10 | +# Mixpanel Migration Guide |
| 11 | + |
| 12 | +Switching from Mixpanel to Statsig is a smart move for teams seeking a unified platform that combines analytics, experimentation, and feature flagging. This all-in-one approach empowers faster, more informed decisions without data silos. |
| 13 | + |
| 14 | +Migrating Mixpanel data into Statsig usually involves three steps: export, transform, and ingest. This guide provides the essentials. For anything beyond these basics, please contact us. |
| 15 | + |
| 16 | +**Note:** We will only cover importing raw events into Statsig. We don't support importing user/group profiles, dashboards, reports, etc. Once your raw events are in the Statsig project, you can re-create your critical dashboards here. |
| 17 | + |
| 18 | +## Step 1. Export your data from Mixpanel |
| 19 | + |
| 20 | +Mixpanel offers a few different export methods. Pick the one that matches your data size and setup: |
| 21 | + |
| 22 | +**1. CSV Export** |
| 23 | + |
| 24 | +Export small batches of events as CSV via the Events tab → query events → click "Export" button. |
| 25 | + |
| 26 | +**2. Export API** |
| 27 | + |
| 28 | +Use Mixpanel's [Raw Event Export API](https://developer.mixpanel.com/reference/raw-event-export) to pull JSONL data: |
| 29 | +- **Limit**: Export one day's data at a time for optimal performance |
| 30 | +- **Format**: JSONL where each line is a valid JSON object |
| 31 | + |
| 32 | +```bash |
| 33 | +curl --location --request GET 'https://data.mixpanel.com/api/2.0/export?from_date=2023-01-01&to_date=2023-01-01' \ |
| 34 | +-u '{project_id}:{service_account_secret}' |
| 35 | +``` |
| 36 | + |
| 37 | +**3. Data Pipelines (Bulk Export)** |
| 38 | + |
| 39 | +For large data volumes, use Mixpanel's [Data Pipelines](https://docs.mixpanel.com/docs/data-pipelines) feature to export to: |
| 40 | +- Cloud Storage (AWS S3, Google Cloud Storage, Azure Blob Storage) |
| 41 | +- Data Warehouse (BigQuery, Redshift, Snowflake) |
| 42 | + |
| 43 | +## Step 2. Transform your data |
| 44 | + |
| 45 | +Mixpanel and Statsig store events in slightly different formats. Map your Mixpanel data to Statsig's format: |
| 46 | + |
| 47 | +| Mixpanel field | Statsig field | |
| 48 | +|----------------|---------------| |
| 49 | +| `event` | `event` | |
| 50 | +| `properties.time` | `timestamp` (ms since epoch) | |
| 51 | +| `properties.distinct_id` or `properties.user_id` | `user.userID` | |
| 52 | +| `properties.device_id` | `user.stableID` | |
| 53 | +| `properties.*` (other fields) | `metadata` | |
| 54 | + |
| 55 | +**Before transform** |
| 56 | + |
| 57 | +```json |
| 58 | +// Mixpanel event |
| 59 | +{ |
| 60 | + "event": "Signed up", |
| 61 | + "properties": { |
| 62 | + "time": 1618716477000, |
| 63 | + "distinct_id": "user-123", |
| 64 | + "device_id": "xyz", |
| 65 | + "Referred_by": "Friend", |
| 66 | + "URL": "website.com/signup" |
| 67 | + } |
| 68 | +} |
| 69 | +``` |
| 70 | + |
| 71 | +**After transform** |
| 72 | + |
| 73 | +```json |
| 74 | +// Statsig event |
| 75 | +{ |
| 76 | + "event": "Signed up", |
| 77 | + "user": { |
| 78 | + "userID": "user-123", |
| 79 | + "stableID": "xyz" |
| 80 | + }, |
| 81 | + "timestamp": 1618716477000, |
| 82 | + "metadata": { |
| 83 | + "Referred_by": "Friend", |
| 84 | + "URL": "website.com/signup" |
| 85 | + } |
| 86 | +} |
| 87 | +``` |
| 88 | + |
| 89 | +## Step 3. Import into Statsig |
| 90 | + |
| 91 | +Once your data looks like Statsig events, you can start bringing them in: |
| 92 | + |
| 93 | +| If you exported from Mixpanel via... | Import into Statsig using... | Best when... | |
| 94 | +|--------------------------------------|------------------------------|--------------| |
| 95 | +| S3 export | [S3 ingestion](/data-warehouse-ingestion/s3) | You're backfilling large datasets | |
| 96 | +| Warehouse (Snowflake/BigQuery/Redshift) | [Warehouse ingestion](/data-warehouse-ingestion/introduction) | Your Mixpanel data already lives in a warehouse | |
| 97 | +| Export API | [Event Webhook](https://docs.statsig.com/http-api#post-event-webhook) | You're moving a few days/weeks of data programmatically | |
| 98 | +| CSV download | [Event Webhook](https://docs.statsig.com/http-api#post-event-webhook) | You're testing or moving a small slice of data | |
| 99 | + |
| 100 | +**Event Webhook (for API/CSV exports)** |
| 101 | + |
| 102 | +```bash |
| 103 | +curl -X POST https://api.statsig.com/v1/webhooks/event_webhook \ |
| 104 | +-H "Content-Type: application/json" \ |
| 105 | +-H "STATSIG-API-KEY: $STATSIG_SERVER_SECRET" \ |
| 106 | +-d '{ |
| 107 | + "event": "Signed up", |
| 108 | + "user": { |
| 109 | + "userID": "user-123", |
| 110 | + "stableID": "xyz" |
| 111 | + }, |
| 112 | + "timestamp": 1618716477000, |
| 113 | + "metadata": { |
| 114 | + "Referred_by": "Friend", |
| 115 | + "URL": "website.com/signup" |
| 116 | + } |
| 117 | +}' |
| 118 | +``` |
| 119 | + |
| 120 | +**Important notes:** |
| 121 | +- **S3 ingestion**: Shard your Mixpanel data into 1 day's data per directory for Statsig |
| 122 | +- **Scale gradually**: After small tests, backfill in chunks to manage loads |
| 123 | +- **Future tracking**: After historical import, switch Mixpanel code calls to Statsig SDKs |
| 124 | + |
| 125 | +## Not sure where to start or need help? |
| 126 | + |
| 127 | +If you're unsure how to approach Mixpanel migration, please reach out to our team. We have worked with other Mixpanel customers in the past to help them switch over to Statsig. |
| 128 | + |
| 129 | +We're always happy to discuss your team's individual needs or any other question you have - drop us a line at [support@statsig.com](mailto:support@statsig.com) or reach out on our [slack community](https://statsig.com/slack). |
| 130 | + |
0 commit comments