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. |
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. |
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.
- Select the column to be used for Insert ID.
- 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
- Check the preview to ensure that everything looks correct, and then create the event.
Was this page useful?