On this page

Migrate your analytics data from Mixpanel

Step-by-step guide to migrating product analytics from Mixpanel to Statsig, including event mapping, user identity, and dashboard recreation.

Migrating from Mixpanel to Statsig gives teams a unified platform that combines analytics, experimentation, and feature flagging, which enables faster and more informed decisions without data silos.

Migrating Mixpanel data into Statsig usually involves three steps: export, transform, and ingest. This guide provides the essentials. For anything beyond these basics, contact Statsig.

This guide covers only importing raw events into Statsig. Statsig doesn'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 there.

Step 1. Export your data from Mixpanel

Mixpanel offers a few different export methods. Pick the one that matches your data size and setup:

1. CSV Export

Export small batches of events as CSV using the Events tab → query events → click "Export" button.

2. Export API

Use Mixpanel's Raw Event Export API to pull JSONL data:
  • Limit: Export one day's data at a time for optimal performance
  • Format: JSONL where each line is a valid JSON object
bash
curl --location --request GET 'https://data.mixpanel.com/api/2.0/export?from_date=2023-01-01&to_date=2023-01-01' \
-u '{project_id}:{service_account_secret}'

3. Data Pipelines (Bulk Export)

For large data volumes, use Mixpanel's Data Pipelines feature to export to:
  • Cloud Storage (AWS S3, Google Cloud Storage, Azure Blob Storage)
  • Data Warehouse (BigQuery, Redshift, Snowflake)

Step 2. Transform your data

Mixpanel and Statsig store events in slightly different formats. Map your Mixpanel data to Statsig's format:

Before transform

json
// Mixpanel event
{
  "event": "Signed up",
  "properties": {
    "time": 1618716477,
    "distinct_id": "user-123",
    "device_id": "xyz",
    "Referred_by": "Friend",
    "URL": "website.com/signup"
  }
}

After transform

json
// Statsig event
{
  "event": "Signed up",
  "user": {
    "userID": "user-123",
    "stableID": "xyz"
  },
  "timestamp": 1618716477000,
  "metadata": {
    "Referred_by": "Friend",
    "URL": "website.com/signup"
  }
}

Step 3. Import into Statsig

After your data is in Statsig event format, choose an import path:

Event Webhook (for API/CSV exports)

bash
curl -X POST https://api.statsig.com/v1/webhooks/event_webhook \
-H "Content-Type: application/json" \
-H "STATSIG-API-KEY: $STATSIG_SERVER_SECRET" \
-d '{
  "event": "Signed up",
  "user": {
    "userID": "user-123",
    "stableID": "xyz"
  },
  "timestamp": 1618716477000,
  "metadata": {
    "Referred_by": "Friend",
    "URL": "website.com/signup"
  }
}'

Important notes:

  • S3 ingestion: Shard your Mixpanel data into 1 day's data per directory for Statsig
  • Scale gradually: After small tests, backfill in chunks to manage loads
  • Future tracking: After historical import, switch Mixpanel code calls to Statsig SDKs

Get migration help

If you are unsure how to approach this migration, contact the Statsig team. Statsig has experience helping customers migrate from Mixpanel.

Reach out to the support team, your sales contact, or through the Slack community.

Was this helpful?