Migrate from Mixpanel
What carries over
| Mixpanel concept | SaaS Tracker equivalent |
|---|---|
mixpanel.track() | tracker.track() |
mixpanel.identify() | tracker.identify() |
mixpanel.people.set() | Traits object in tracker.identify() |
| Events (JQL export) | Import via Batch API |
Migration steps
Export events from Mixpanel
Use Mixpanel’s Raw Data Export API or the dashboard CSV export.
curl "https://data.mixpanel.com/api/2.0/export/?from_date=2024-01-01&to_date=2025-04-23&event=[\"page_view\",\"signup\"]" \
-u "$MIXPANEL_SECRET:" \
> mixpanel_export.ndjson💡
Mixpanel exports one JSON object per line (NDJSON format) — no transformation needed for the event shape itself.
Map Mixpanel event structure to SaaS Tracker
// Each line in mixpanel_export.ndjson looks like:
// {"event": "page_view", "properties": {"distinct_id": "u1", "time": 1714000000, ...}}
const lines = require('fs').readFileSync('mixpanel_export.ndjson', 'utf8').split('\n').filter(Boolean);
const transformed = lines.map(line => {
const { event, properties } = JSON.parse(line);
const { distinct_id, time, ...rest } = properties;
return {
event,
distinctId: distinct_id,
timestamp: new Date(time * 1000).toISOString(),
properties: { ...rest, $migrated_from: 'mixpanel' },
};
});
require('fs').writeFileSync('st_events.ndjson', transformed.map(e => JSON.stringify(e)).join('\n'));Ingest via Batch API
Follow the same batching steps as the PostHog migration guide.
Replace the Mixpanel SDK
- import mixpanel from 'mixpanel-browser';
- mixpanel.init('your-token');
- mixpanel.track('page_view', { url: '/' });
- mixpanel.identify('user-123');
+ import { SaaSTracker } from '@saas-tracker/sdk';
+ const tracker = new SaaSTracker({ apiKey: process.env.ST_API_KEY });
+ tracker.track('page_view', { url: '/' });
+ tracker.identify('user-123');JQL migrations
If you relied on Mixpanel’s JQL for custom queries, the AI chart builder can express the same queries in plain English. For complex analyses, use the raw ClickHouse SQL export in Saved Queries → Export.