Mixpanel
Send tracked database events to Mixpanel for analytics
Configuration
To configure Mixpanel as a destination for your tracked events, add the following to your pg_track_events.config.yaml
file:
Configuration Options
filter
: Event name glob filter (optional) Learn about filtering eventsprojectToken
: Your Mixpanel project token (required). Can be hardcoded directly in the YAML or reference an environment variable.apiEndpoint
: (optional) Custom API endpoint URL for Mixpanel. Defaults to US cloud.dataEndpoint
: (optional) Custom data endpoint URL for Mixpanel. Defaults to US cloud.
Getting Your Mixpanel Project Token
To find your project token:
- Log in to your Mixpanel account
- Go to project settings: https://mixpanel.com/settings/project/
- Look for "Access Keys" section
- Copy your project token
Distinct IDs
The system automatically extracts a distinct ID from your event properties for user identification in the following order:
distinct_id
property- Common user ID fields (
user_id
,userid
,_user_id
) - For tables named
users
,user
, or_users
, it will look for anid
field
If no ID is found, the distinct ID will be null
.
Note
After making configuration changes, restart the pg_track_events agent for them to take effect.