Mixpanel
Server-side event and profile delivery to Mixpanel via the Ingestion API for product analytics, funnel analysis, and user segmentation.
This blueprint is currently alpha — schema and behaviour may change before GA.
Prerequisites
Before configuring Mixpanel in Datafly Signal, you need a Mixpanel account, a project, and your project token and API secret.
Step 1: Create a Mixpanel Account
- Go to mixpanel.com and click Get Started or Sign Up Free.
- Sign up with your email, Google, or SSO provider.
- During onboarding, select your data residency region:
- United States (default): Data stored in US data centers.
- European Union: Data stored in EU data centers. Required for GDPR compliance if your users are in the EU.
Data residency is set at the organization level during sign-up and cannot be changed later. All projects within the organization inherit this setting. If you need both US and EU residency, you must create separate organizations.
Step 2: Create a Project
- In the Mixpanel dashboard, click the project selector in the top-left corner.
- Click Create New Project.
- Enter a project name (e.g. “My Website - Production”).
- Select a timezone for your project reporting.
- Click Create.
Step 3: Find Your Project Token
- In the Mixpanel dashboard, click the Settings gear icon.
- Go to Project Settings.
- Under Access Keys, locate the Project Token.
- Copy the token — this is the primary identifier for your project.
The Project Token is safe to use server-side. It identifies your project but cannot be used to read data. You will also need the API Secret for server-side authentication.
Step 4: Find Your API Secret
- On the same Project Settings page, locate the API Secret under Access Keys.
- Click Show to reveal the API Secret.
- Copy the value.
The API Secret provides write access to your Mixpanel project. Keep it secure and never expose it in client-side code.
Step 5: Confirm Your Data Residency
To verify which data residency region your organization uses:
- US: Your Mixpanel dashboard URL starts with
mixpanel.com - EU: Your Mixpanel dashboard URL starts with
eu.mixpanel.com
Select the matching region when configuring the integration in Datafly Signal. This determines which API endpoint events are sent to:
- US:
https://api.mixpanel.com - EU:
https://api-eu.mixpanel.com
API Endpoint
POST https://api.mixpanel.com/track (US - events)
POST https://api.mixpanel.com/engage (US - profiles)
POST https://api-eu.mixpanel.com/track (EU - events)
POST https://api-eu.mixpanel.com/engage (EU - profiles)Events and profile updates are sent as JSON payloads. Authentication is handled via the project token in the request body.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
project_token | string | Yes | Your Mixpanel project token. Found in Project Settings > Access Keys. |
api_secret | secret | Yes | Your Mixpanel project API secret for server-side authentication. Found in Project Settings > Access Keys. |
eu_data_residency | boolean | No | Enable to send data to Mixpanel’s EU data center (api-eu.mixpanel.com). Required for EU-resident organizations. Defaults to false (US). |
Management UI Setup
- Go to Integrations in the sidebar.
- Open the Integration Library tab.
- Find Mixpanel or filter by Analytics.
- Click Install, select a variant if available, and fill in the required fields:
- Enter your Project Token from Step 3.
- Paste your API Secret from Step 4.
- Toggle EU Data Residency on if your organization is EU-based (Step 5).
- Click Install Integration to create the integration with a ready-to-use default blueprint.
Management API Setup
curl -X POST http://localhost:8084/v1/admin/integration-catalog/mixpanel/install \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Mixpanel",
"variant": "default",
"config": {
"project_token": "abc123def456789",
"api_secret": "your_api_secret",
"eu_data_residency": false
},
"delivery_mode": "server_side"
}'Variants
| Variant | Key | Description |
|---|---|---|
| Retail | retail | E-commerce event tracking with distinct_id matching. |
| B2B / SaaS | b2b_saas | Product analytics with feature tracking and subscription events. |
Each variant provides a tuned default blueprint. You can customise any setting after installation.
Identity
Mixpanel uses a two-part identity model based on distinct_id and $user_id.
Anonymous Users
Before a user is identified, Datafly Signal sends the Datafly anonymous_id as Mixpanel’s distinct_id. This creates an anonymous user profile in Mixpanel.
Identified Users
When your application calls datafly.identify(userId), Datafly Signal sends the user ID as $user_id and calls Mixpanel’s $identify operation to merge the anonymous and known user profiles.
datafly.identify("user-123", {
email: "jane@example.com",
plan: "premium"
});How Mixpanel Resolves Identity
- Anonymous visitor: Events arrive with
distinct_idset to the Datafly anonymous ID. - User identifies: A call to
datafly.identify("user-123")triggers a$identifyevent linking the anonymousdistinct_idto the known$user_id. - Merge: Mixpanel merges the anonymous and identified profiles, attributing prior anonymous activity to the identified user.
- Subsequent events: All future events include
$user_idas thedistinct_id.
Event Mapping
The Retail variant maps the following events to Mixpanel’s product-analytics event names:
| Datafly Event | Mixpanel Event | Notes |
|---|---|---|
page | page | Page URL, title, referrer sent as event properties |
Product Viewed | Product Viewed | Product details as event properties |
Product Added | Add to Cart | Product details as event properties |
Order Completed | Purchase | Triggers revenue tracking (see below) |
| Custom events | Passed through | Any datafly.track("event_name") is sent with its original name |
Identity (default blueprint)
The default blueprint forwards the following identifiers:
| Source | Mixpanel field |
|---|---|
user_id | properties.distinct_id |
context.ip | properties.$ip |
For anonymous visitors, Signal uses the anonymous identifier so events still create a profile in Mixpanel. When datafly.identify() is called, subsequent events resolve to the identified user.
Consent
Default consent category: analytics. Events are suppressed for visitors who have not consented to analytics tracking.
Revenue Tracking
When Datafly Signal receives an Order Completed event, it maps the transaction data to Mixpanel’s revenue tracking:
| Datafly Property | Mixpanel Property | Description |
|---|---|---|
total or revenue | $amount | Total transaction value |
currency | $currency | ISO 4217 currency code |
order_id | Order ID | Transaction identifier |
products[].product_id | Product ID | Product identifier |
Revenue events appear in Mixpanel’s Revenue report and are attached to the user profile via the $transaction people operation.
User Properties
When datafly.identify() is called with traits, those traits are forwarded to Mixpanel as profile properties via the $set operation on the /engage endpoint:
{
"token": "abc123def456789",
"distinct_id": "user-123",
"$set": {
"$email": "jane@example.com",
"$name": "Jane Smith",
"plan": "premium",
"company": "Acme Inc"
}
}Mixpanel reserves certain property names (prefixed with $) for standard fields like $email, $name, $phone, and $city. Datafly Signal automatically maps common trait names to the corresponding Mixpanel reserved properties.
Verify it’s working
- In the Signal Management UI, open your Mixpanel integration and watch the Live Events stream as you trigger events on your site.
- Confirm 200 responses from the Mixpanel
/trackendpoint. - In Mixpanel, open Events in the left sidebar — events arrive in seconds.
Testing
Once your integration is active and events are flowing, verify in Mixpanel:
- In the Mixpanel dashboard, go to Events in the left sidebar.
- The Events feed shows events arriving in real-time — look for your tracked event names.
- Click on an event to inspect its properties and verify the data is correct.
- Go to Users and search by
distinct_idor user properties to find a specific user profile. - Check the user’s Activity Feed to see their full event history.
Mixpanel processes events in near real-time. Events typically appear in the dashboard within seconds.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| No events in dashboard | Incorrect project token | Verify the project token matches your project in Project Settings > Access Keys |
| Events arrive but user profiles are empty | Profile updates not enabled | Ensure identify calls include user traits and the blueprint maps to the /engage endpoint |
| Data missing in EU project | Wrong data residency setting | Enable eu_data_residency in the integration config — US and EU endpoints are completely separate |
401 authentication error | Invalid API secret | Regenerate the API secret in Project Settings > Access Keys |
| Revenue not appearing | Missing $amount property | Ensure Order Completed events include a total or revenue property |
| Duplicate user profiles | Identity not merged | Verify that datafly.identify() is called before or alongside tracked events so the $identify operation links anonymous and known IDs |
400 bad request | Malformed event payload | Check Datafly Signal delivery logs for the full Mixpanel error response |
| Events sent to wrong project | Token mismatch | Each Mixpanel project has a unique token — verify you are using the correct one |
Delivery
Events are delivered server-side from your Datafly Signal infrastructure directly to the Mixpanel Ingestion API. No client-side Mixpanel scripts are loaded for this integration.
Visit the Mixpanel Ingestion API documentation for full API reference and advanced configuration options.
Blueprint
The Mixpanel blueprint version is 0.1.0 (alpha). It ships with Retail and B2B / SaaS variants covering pages, product views, add-to-cart, and purchase.