Sending Events
Format Data for Mixpanel Ingestion
To import data from a warehouse directly, you need to format tables correctly.
Each column in the table will be mapped as a property on the event.
Read more about best practices for tracking Events and Properties in Mixpanel here.
The following columns should be mapped from your warehouse table:
Name | Type | Description |
---|---|---|
Event Name | STRING | The name of the event that occurred. This can be specified as a table column that contains the event name, or as a static value (one event name for the whole table). |
Event Time | TIMESTAMP | The time when an event occurred. |
Distinct ID | STRING, INT | The identifier of the user that performed the event. Learn more about identifying users. |
JSON Properties Optional | JSON | If your table stores data in a JSON column, you may chose to ingest that data as event properties. If there is a conflict between the name of a table column and one of the keys in the JSON column, the table column will take precedence. |
Event Tables
Once you have created a warehouse source, follow the below steps to send events into Mixpanel.
- Go to Project Settings > Warehouse Data.
- Click on + Create and select Event Table.
- Select your warehouse as source from the dropdown.
- Navigate to the dataset or database where your Events table is.
- Select the Table.
- Specify the Event Name:
- You can specify the column which has the event name.
- OR You can specify the event name for all the events.
- Specify the Event Time:
- This is the time the event occurred.
- Identity Management:
- If your project has Simplified ID Merge, the warehouse connector will prompt you to map the
$device_id
and$user_id
properties to columns in your table during setup. For more information on how we map those fields to the resulting distinct id, refer to our documentation here. - If your project has Original ID Merge, the warehouse connector will prompt you to map the Distinct ID column. This column represents the entity to which the events belong; it could be a user or a device. If you want to map two entities together you have to additionally call either
$identify
,$merge
,$alias
functions, along with their corresponding properties. For more information, refer to our documentation here.
- If your project has Simplified ID Merge, the warehouse connector will prompt you to map the
- Specify sync settings (see below)
- Check the preview to ensure that everything looks correct, and then create the event.
Sync Settings
Sync Mode determines how Mixpanel finds new or changed data in the warehouse to send to Mixpanel. The two options for event data are:
Time Based Sync
Time-based syncs are suitable for append-only tables with an "insert timestamp" column. When the sync runs it will query the warehouse for rows where "insert timestamp" is greater than the highest value seen last time the sync ran. The following additional columns must be mapped from the warehouse when using a time based sync:
Name | Type | Description |
---|---|---|
Insert Time | TIMESTAMP | The time when the event was inserted into the warehouse. This is used as a watermark to figure out which events are new and ingest them. |
Insert ID Optional | STRING | A unique identifier of the event. We recommend this as a best practice in case duplicate events need to be reconciled. |
Mirror sync
Mirror syncing is in early access and not available on all projects. Request access here.
Mirror syncs track all changes to event data in the data warehouse (inserts, updates, and deletes) and mirrors them to Mixpanel.
Warehouse sources need extra configuration to be Mirror-ready. See warehouse source documentation for supported warehouses for more details:
Note: For billing purposes updates and deletes performed by Mirror syncs are tracked separately from events ingested. During early access there is no charge for updates or deletes performed by mirror mode, however high volumes of updates relative to a project's event plan limit may make the project unsuitable for early access.
Was this page useful?