Skip to main content

Mixpanel Destination

Sync user profiles or events from your warehouse to Mixpanel via the /engage (profile-set) or /import (events) APIs.

YAML Example — user profiles (people_set)​

destination:
type: mixpanel
endpoint: people_set
project_token_env: MIXPANEL_TOKEN
distinct_id_field: user_id
properties_template: |
{
"plan": "{{ row.plan }}",
"signup_source": "{{ row.source }}"
}

YAML Example — events (import)​

destination:
type: mixpanel
endpoint: import_events
project_id: "1234567"
service_account_username_env: MIXPANEL_SA_USERNAME
service_account_secret_env: MIXPANEL_SA_SECRET
distinct_id_field: user_id
event_name: signup_completed
time_field: event_time

Configuration​

FieldTypeDefaultDescription
type"mixpanel"—Required
endpointpeople_set|import_eventspeople_set/engage profile-set or /import events
regiondefault|eudefaultAPI region (api.mixpanel.com vs api-eu.mixpanel.com)
project_tokenstring | nullnullProject token for people_set (direct value)
project_token_envstring | nullMIXPANEL_TOKENEnv var containing the project token
project_idstring | nullnullNumeric project id, required for import_events
service_account_usernamestring | nullnullService account username for import_events
service_account_username_envstring | nullMIXPANEL_SA_USERNAMEEnv var containing the service account username
service_account_secretstring | nullnullService account secret for import_events
service_account_secret_envstring | nullMIXPANEL_SA_SECRETEnv var containing the service account secret
distinct_id_fieldstringdistinct_idSource column for the Mixpanel distinct id
event_name_fieldstring | nullnullSource column for the event name (import_events)
event_namestring | nullnullConstant event name (alternative to event_name_field)
time_fieldstring | nullnullSource column for event time (Unix seconds); defaults to now
insert_id_fieldstring | nullnullSource column for $insert_id; derived deterministically if unset
properties_templatestring | nullnullJinja2 template rendering a JSON object merged into the profile $set or the event properties
batch_sizeint2000Records per API request (clamped to 1–2000, Mixpanel's limit)
retryRetryConfig | nullnullDestination-level retry override

Authentication​

people_set uses your project token (Mixpanel Settings → Project Settings), carried inside each record — no auth header:

export MIXPANEL_TOKEN="your-project-token"

import_events uses a service account (Mixpanel Organization Settings → Service Accounts) plus the numeric project_id:

export MIXPANEL_SA_USERNAME="your-service-account.mp-service-account"
export MIXPANEL_SA_SECRET="your-service-account-secret"

Notes​

  • Both endpoints batch up to 2000 records per request.
  • For import_events, each event gets a deterministic $insert_id (derived from the row contents when insert_id_field is unset), so re-running the same sync does not double-count events in Mixpanel.
  • EU data residency: set region: eu to route to api-eu.mixpanel.com.

References​