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

  1. Go to mixpanel.com and click Get Started or Sign Up Free.
  2. Sign up with your email, Google, or SSO provider.
  3. 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

  1. In the Mixpanel dashboard, click the project selector in the top-left corner.
  2. Click Create New Project.
  3. Enter a project name (e.g. “My Website - Production”).
  4. Select a timezone for your project reporting.
  5. Click Create.

Step 3: Find Your Project Token

  1. In the Mixpanel dashboard, click the Settings gear icon.
  2. Go to Project Settings.
  3. Under Access Keys, locate the Project Token.
  4. 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

  1. On the same Project Settings page, locate the API Secret under Access Keys.
  2. Click Show to reveal the API Secret.
  3. 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

FieldTypeRequiredDescription
project_tokenstringYesYour Mixpanel project token. Found in Project Settings > Access Keys.
api_secretsecretYesYour Mixpanel project API secret for server-side authentication. Found in Project Settings > Access Keys.
eu_data_residencybooleanNoEnable 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

  1. Go to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Mixpanel or filter by Analytics.
  4. 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).
  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

VariantKeyDescription
RetailretailE-commerce event tracking with distinct_id matching.
B2B / SaaSb2b_saasProduct 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

  1. Anonymous visitor: Events arrive with distinct_id set to the Datafly anonymous ID.
  2. User identifies: A call to datafly.identify("user-123") triggers a $identify event linking the anonymous distinct_id to the known $user_id.
  3. Merge: Mixpanel merges the anonymous and identified profiles, attributing prior anonymous activity to the identified user.
  4. Subsequent events: All future events include $user_id as the distinct_id.

Event Mapping

The Retail variant maps the following events to Mixpanel’s product-analytics event names:

Datafly EventMixpanel EventNotes
pagepagePage URL, title, referrer sent as event properties
Product ViewedProduct ViewedProduct details as event properties
Product AddedAdd to CartProduct details as event properties
Order CompletedPurchaseTriggers revenue tracking (see below)
Custom eventsPassed throughAny datafly.track("event_name") is sent with its original name

Identity (default blueprint)

The default blueprint forwards the following identifiers:

SourceMixpanel field
user_idproperties.distinct_id
context.ipproperties.$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.

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 PropertyMixpanel PropertyDescription
total or revenue$amountTotal transaction value
currency$currencyISO 4217 currency code
order_idOrder IDTransaction identifier
products[].product_idProduct IDProduct 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

  1. In the Signal Management UI, open your Mixpanel integration and watch the Live Events stream as you trigger events on your site.
  2. Confirm 200 responses from the Mixpanel /track endpoint.
  3. 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:

  1. In the Mixpanel dashboard, go to Events in the left sidebar.
  2. The Events feed shows events arriving in real-time — look for your tracked event names.
  3. Click on an event to inspect its properties and verify the data is correct.
  4. Go to Users and search by distinct_id or user properties to find a specific user profile.
  5. 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

SymptomCauseFix
No events in dashboardIncorrect project tokenVerify the project token matches your project in Project Settings > Access Keys
Events arrive but user profiles are emptyProfile updates not enabledEnsure identify calls include user traits and the blueprint maps to the /engage endpoint
Data missing in EU projectWrong data residency settingEnable eu_data_residency in the integration config — US and EU endpoints are completely separate
401 authentication errorInvalid API secretRegenerate the API secret in Project Settings > Access Keys
Revenue not appearingMissing $amount propertyEnsure Order Completed events include a total or revenue property
Duplicate user profilesIdentity not mergedVerify that datafly.identify() is called before or alongside tracked events so the $identify operation links anonymous and known IDs
400 bad requestMalformed event payloadCheck Datafly Signal delivery logs for the full Mixpanel error response
Events sent to wrong projectToken mismatchEach 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.

See also

  • Amplitude — alternative product analytics destination.
  • Heap — autocapture product analytics.