Skip to content

Mixpanel

The Mixpanel modules enable you to track events, create/update user or group profiles, or perform an API call in your Mixpanel account.

Getting Started With Mixpanel

Prerequisites

  • A Mixpanel account

In order to use Mixpanel with Ibexa Connect, it is necessary to have a Mixpanel account. If you do not have one, you can create a Mixpanel account at Mixpanel.com.

Note

The module dialog fields that are displayed in bold (in the Ibexa Connect scenario, not in this documentation article) are mandatory!

Connecting Mixpanel to Ibexa Connect

To connect your Mixpanel account to Ibexa Connect, you need to obtain the token.

1. Log in to your Mixpanel account.

2. Click on the cog wheel icon in the top-right corner, and then on your project name in the Project Settings section.

61d6a9b0d4b7a.gif

3. Find and copy your Token or API Secret (depending on the module you want to use) in the Access Keys section.

61d6a9b36bb7e.png

4. Go to Ibexa Connect, and open the Mixpanel module's Create a connection dialog.

5. Enter the Token or API Secret you have copied in step 3 in the respective field, and click the Continue button to establish the connection.

The connection has been established. You can proceed with setting up the module.

Actions

Track an Event

Sends a tracking event.

Event Enter a name for the event. For example, "Signed Up", or "Uploaded Photo".
Distinct ID Enter the desired ID for the event.

The value of distinct_id will be treated as a string and used to uniquely identify a user associated with your event. If you provide a distinct_id property with your events, you can track a given user through funnels and distinguish unique users for retention analyses. You should always send the same distinct_id when an event is triggered by the same user.
Time Enter the time an event occurred. If this property is not included in your request, Mixpanel will use the time the event arrives at the server.
Name Specify the name property.
Additional Properties Add properties in the JSON format you want to send with this event.

A collection of additional properties associated with this event. You can use these properties to filter or segment events in Mixpanel. In addition, some properties are treated specially by Mixpanel. Because Mixpanel accepts any JSON-valid data as the request payload, you're able to map any value to this field. However, if you'd like to map values from a JSON string, please use the JSON - Parse JSON module, and then map the output to this field.

61d6a9b47524c.png

61d6a9b59926e.png

Create or Update a User Profile

Creates or updates a user.

Distinct ID

Enter the string that identifies the profile you would like to update or create. Updates with the same $distinct_id refer to the same profile. If this $distinct_id matches a distinct_id you use in your events, those events will show up in the activity feed associated with the profile you've updated.

Operation

Select the user profile operation you want to perform:(reference: https://developer.mixpanel.com/docs/http#section-update-operations)

Set Takes the names and values of profile properties (below). If the profile does not exist, it creates it with these properties. If it does exist, it sets the properties to these values, overwriting existing values.
Set Once Works just like Set (above), except it will not overwrite existing property values. This is useful for properties like "First login date".
Add Takes keys and numerical values. Add will increment the value of a user profile property. When processed, the property values are added to the existing values of the properties on the profile. If the property is not present on the profile, the value will be added to 0. It is possible to decrement by calling Add with negative values. This is useful for maintaining the values of properties like "Number of Logins" or "Files Uploaded".
Append Takes keys and values, and appends each to a list associated with the corresponding property name. $appending to a property that doesn't exist will result in assigning a list with one element to that property.
Union Takes keys and list values. The list values in the request are merged with the existing list on the user profile, ignoring duplicate list values.
Remove Takes keys and values. The value in the request is removed from the existing list on the user profile. If it does not exist, no updates are made.
Unset Takes property names, and permanently removes the properties and their values from a profile.
Delete Permanently delete the profile from Mixpanel, along with all of its properties. The value is ignored - the profile is determined by the Distinct ID from the request itself.

Properties

Specify the user profile properties you want to create or update.

First Name Should be set to the first and last name of the user represented by the profile. If these are set, the full name of the user will be displayed in Mixpanel reports.
Last Name Can be set to the user's full name as an alternative to having two separate first and last name properties.
Created Enter the date of the user profile creation. Please refer to the list of supported date and time formats.
Email Enter the user's email address. Mixpanel will use this email when sending email messages to your users and for displaying the user's gravatar image in reports.
Phone Enter the user's phone number. Mixpanel will use the phone property when sending SMS messages to your users.
Avatar Enter the URL of a gif, jpg, jpeg, or png to update the profile picture in a profile.
Additional Properties Add custom properties to define the customer. Because Mixpanel accepts any JSON-valid data as the operation payload, you're able to map any value to this field. However, if you'd like to map values from a JSON string, please use the JSON - Parse JSON module, and then map the output to this field.

Create or Update a Group Profile

Creates or updates a group.

Group Key

Enter the group key (connects event data for Group Analytics).

If the property “company” is chosen for Group Analytics, “company” is the group_key, and “Mixpanel”, “Company A”, and “13254” are all potential group_id values.

Group ID

Enter the identifier for a specific group.

Operation

Select the user profile operation you want to perform:(reference: https://developer.mixpanel.com/docs/http#section-update-operations)

Set Updates or adds a property to a group.
Set Once Adds a property value to a group only if it has not been set before.
Union Adds the specified values to a list property and ensures that those values only appear once.
Remove Removes a specific value in a list property.
Unset Unsets a specific property in the group.
Delete Deletes a group profile from Mixpanel.

Properties

Specify the group profile properties you want to create or update.

Name Specify the name to populate the name field at the top of the group profile.
Additional Properties Custom properties to define the group. Because Mixpanel accepts any JSON-valid data as the operation payload, you're able to map any value to this field. However, if you'd like to map values from a JSON string, please use the JSON - Parse JSON module, and then map the output to this field.
Properties to unset Enter property names to permanently remove the properties and their values from a profile.

Make a Query API Call

Allows you to perform a custom API call to the Query API.

URL Enter a path relative to https://mixpanel.com/api. For example: /2.0/segmentation/.

Note: For the list of available endpoints, refer to the Mixpanel Query API Documentation.

Method

Select the HTTP method you want to use:

GET to retrieve information for an entry.

POST to create a new entry.

PUT to update/replace an existing entry.

PATCH to make a partial entry update.

DELETE to delete an entry.

Headers

Enter the desired request headers. You don't have to add authorization headers; we've already done this for you.

Query String

Enter the request query string.

Body

Enter the body content for your API call.

Example of Use - List Users

The following API call returns all users that fit specified parameters in your Mixpanel account:

URL: /2.0/engage/

Method: GET

61d6a9b72dee2.png

The result can be found in the module's Output under Bundle > Body > results. In our example, 2 users were returned:

61d6a9b84882b.png

Make an Ingestion API Call

Allows you to perform a custom API call to the Ingestion API.

URL Enter a path relative to https://api.mixpanel.com. For example: /groups.

Note: For the list of available endpoints, refer to the Mixpanel Ingestion API Documentation.

Method

Select the HTTP method you want to use:

GET to retrieve information for an entry.

POST to create a new entry.

PUT to update/replace an existing entry.

PATCH to make a partial entry update.

DELETE to delete an entry.

Headers

Enter the desired request headers. You don't have to add authorization headers; we've already done that for you.

Query String

Enter the request query string.

Body

Enter the body content for your API call.

Example of Use - Add User

The following API call adds a user with specified properties in your Mixpanel account:

URL: /engage/

Token Key: $token

Data:

1
{ "$distinct_id": "666", "$ip": "123.123.123.123", "$set": { "Address": "1313 Mockingbird Lane", "Birthday": "1948-01-01" }}

61d6a9b95ef87.png

When the user has been successfully created, the Status code: 200 is returned in the module's output:

61d6a9ba86476.png

Import an Old Event

Imports an event older than five days.

Connection

Create a new connection using the API Secret and Token.

The API Secret can be found in the same location as the token (see Connecting Mixpanel to Ibexa Connect).

Event

Enter the name of the event you want to import.

Properties

Distinct ID The user ID you have been sending to Mixpanel up to this point for that user.
Time Enter the time an event occurred. If this property is not included in your request, Mixpanel will use the time the event arrives at the server.
Name Enter the name of the event.
Additional Properties A collection of additional properties associated with this event. You can use these properties to filter or segment events in Mixpanel. In addition, some properties are treated specially by Mixpanel. Because Mixpanel accepts any JSON-valid data as the request payload, you're able to map any value to this field. However, if you'd like to map values from a JSON string, please use the JSON - Parse JSON module, and then map the output to this field.