How to connect to Mixpanel?
To connect to Mixpanel:
1. Login to Mixpanel and obtain the API secret.
2, In the Rest Datasource setup page, supply the User Id and password as the API secret
3. Set the Rest Host as https://mixpanel.com/api/2.0/
4. Save the datasource.
To call into an MixPanel API:
1. From the datasource setup above, create a new query. Spcify the end point. Example: events
2. Pass in the relevant URL parameters. Example:
event=["some event"]&type=general&from_date=2018-05-28&to_date=2018-05-28&unit=minute
(or to supply dynamic dates: event=["some event"]&type=general&from_date={$c9_today-1d:yyyy-MM-dd}&to_date={$c9_today:yyyy-MM-dd}&unit=minute
3. Use Cloud9QL or interact with the results to transform the results appropriately.
-
Official comment
UPDATED INSTRUCTIONS (August 2022):
Setting up the connection to Mixpanel:
1. Navigate to Mixpanel and create a service account (Settings -> Organization Settings -> Service Accounts -> + Add Service Account)-
See Mixpanel documentation: https://developer.mixpanel.com/reference/service-accounts
2. Copy the Username and Secret (Secret will not appear again)
3. Navigate to Knowi and create a REST datasource
4. Enter the following:-
Datasource Name: Name of your choice
-
REST Host: https://data.mixpanel.com/api/2.0/
-
Authentication Type: Basic
-
User ID for Basic Authentication: Username (copied in Step 2)
-
Password for Basic Authentication: API Secret (copied in Step 2)
5. Click 'Save'
To call into the MixPanel API:
1. From the datasource setup above, create a new query.
2. Specify the end point. Example: events
3. Pass in the relevant URL parameters. Example: project_id=PROJECTID&event=["\"someevent\""]&type=general&from_date=2022-05-28&to_date=2022-05-28&unit=minute- (or to supply dynamic dates: project_id=PROJECTID&event=["\"someevent\""]&type=general&from_date={$c9_today-1d:yyyy-MM-dd}&to_date={$c9_today:yyyy-MM-dd}&unit=minute
4. Use Cloud9QL or interact with the results to transform the results appropriately.
Mixpanel Query API documentation: https://developer.mixpanel.com/reference/query-api
The API documentation provides the exact URL parameters required for a given endpoint.Comment actions -
Please sign in to leave a comment.
1 comment