Mixpanel
Mixpanel is an analytics service used for tracking user interactions with web and mobile applications.
Bruin supports Mixpanel as a source for Ingestr assets. You can ingest data from Mixpanel into your data platform.
To set up a Mixpanel connection, add a configuration item in the .bruin.yml file and in your asset file. You can authenticate either with api_secret alone, or with username, password, and project_id. Optionally you can set server (defaults to eu).
Follow these steps to set up Mixpanel and run ingestion.
Configuration
Step 1: Add a connection to the .bruin.yml file
Option 1: Using API Secret
yaml
connections:
mixpanel:
- name: "mixpanel"
api_secret: "your-api-secret"
server: "eu"Option 2: Using Service Account
yaml
connections:
mixpanel:
- name: "mixpanel"
username: "service-account-username"
password: "service-account-secret"
project_id: "12345"
server: "eu"api_secret: Mixpanel API secret. If provided,username,password, andproject_idare not required.username: Mixpanel service account username.password: Secret associated with the service account.project_id: The numeric project ID.server: (Optional) Server region (us,eu, orin). Defaults toeu.
Step 2: Create an asset file for data ingestion
Create an asset configuration file (e.g., mixpanel_ingestion.yml) inside the assets folder with the following content:
yaml
name: public.mixpanel
type: ingestr
parameters:
source_connection: mixpanel
source_table: 'events'
destination: postgresname: The name of the asset.type: Alwaysingestrfor Mixpanel.source_connection: The Mixpanel connection name defined in.bruin.yml.source_table: Name of the Mixpanel table to ingest.destination: The destination connection name.
Available Source Tables
| Table | PK | Inc Key | Inc Strategy | Details |
|---|---|---|---|---|
| events | distinct_id | time | merge | Retrieves events data |
| profiles | distinct_id | last_seen | merge | Retrieves Mixpanel user profiles and attributes. |
Step 3: Run asset to ingest data
bash
bruin run assets/mixpanel_ingestion.ymlRunning this command ingests data from Mixpanel into your Postgres database.
