Mixpanel (Actions) Destination

Destination Info

Mixpanel enables you to build better products through powerful, self-serve product analytics to help you convert, engage, and retain more users.

Benefits of Mixpanel (Actions) vs Mixpanel Classic

Mixpanel (Actions) provides the following benefits over the classic Mixpanel destination:

  • Simpler setup - Mixpanel (Actions) has a streamlined default setup process making it easier to get started in a way that “just works”.
  • More control - Actions-based destinations enable you to define the mapping between the data Segment receives from your source, and the data Segment sends to the destination.
  • Additional default property mappings - More default mappings from the Segment context like app name, app namespace, device type, and more.
  • Improved Groups support - Implementation of Segment Groups with Mixpanel Group Analytics is easier. If you’re already using Segment Groups, no code changes are required.

Getting started

  1. Go to your Mixpanel project settings. Copy the Mixpanel API Key and API Secret for your project.
  2. From the Segment web app, click Catalog, then click Destinations.
  3. Find the Destinations Actions item in the left navigation, and click it.
  4. Click the “Mixpanel” item to select it and click Configure.
  5. Choose which of your sources to connect the destination to. (You can connect more sources to the destination later.)

Connection Modes for Mixpanel (Actions) destination

The Mixpanel (Actions) destination does not offer a device-mode connection mode. If you’re using one of Segment’s new libraries (Analytics.js 2.0, Swift or Kotlin) with the Actions-framework version of the destination, you do not need the device-mode connection.

Once you have a mapping, you can follow the steps in the Destinations Actions documentation on Customizing mappings.

Destination Settings

Setting Description
Secret Key Required.

Mixpanel project secret.

Project Token Required.

Mixpanel project token.

Available Presets

Mixpanel (Actions) has the following presets:

Preset Name Trigger Default Action
Group Calls Event type = "group"
Group Identify User
Page Calls Event type = "page"
Track Event
Screen Calls Event type = "screen"
Track Event
Identify Calls Event type = "identify"
Identify User
Track Calls Event type = "track"
Track Event

Available Actions

Build your own Mappings! Combine supported triggers with the following Mixpanel-supported actions:

Mapping limits per destination

Individual destination instances have support a maximum of 50 mappings.

Alias

Create an alias to a distinct id. This action is primarily supported for the sake of customers using the legacy identity management in their Mixpanel project. For new customers or those who have migrated to the new identity management in Mixpanel should use identify.

Alias is a Cloud action. The default Trigger is:

Click to show / hide fields

Field Description
Alias Type: STRING

A new distinct id to be merged with the original distinct id. Each alias can only map to one distinct id.

Distinct ID Type: STRING

A distinct id to be merged with the alias.

Group Identify User

Updates or adds properties to a group profile. The profile is created if it does not exist. Learn more about Group Analytics.

Group Identify User is a Cloud action. The default Trigger is:

type = "group"

Click to show / hide fields

Field Description
Group Key Type: STRING

The group key you specified in Mixpanel under Project settings. If this is not specified, it will be defaulted to “$group_id”.

Group ID* Type: STRING

The unique identifier of the group. If there is a trait that matches the group key, it will override this value.

Group Properties Type: OBJECT

The properties to set on the group profile.

In the default configuration, Mixpanel (Actions) triggers this action when it receives a Group call.

Group Analytics is available as an add-on package to customers on Growth and Enterprise plans.

This action sets or updates the properties of specific groups. Use this when you want to update properties on a group profile.

The Groups model in Segment is slightly different than in Mixpanel. To explain the conceptual difference, it may help to think in terms of database tables. In Segment, there is a single “groups” table. You can have as many group rows as you want and each row has a unique identifier. When you want to set traits on that group, you only need to know the group id.

However, in Segment you cannot distinguish between “types” of groups. For example, a user can belong to a “Company” as well as a “Team”. There is no way to differentiate between those in Segment. In Mixpanel, you can have multiple group types which are defined by a group key. To update group traits in Mixpanel you need to specify the group key and group id.

Default group key

By default, the Mixpanel (Actions) destination uses $group_id as the group key. Create a new group in Mixpanel with $group_id as the group key to complete the configuration.

  1. Go to your Mixpanel project settings
  2. Scroll to the “Group Keys” section. If this section doesn’t exist, you may not have the Group Analytics add-on.
  3. Create the new group key:

Set Group Key

Using a different group key

If you already have a group set up in Mixpanel with a different group key and wish to use that one, you can specify it in the Group Key field of the destination configuration.

Backwards-compatibility with Mixpanel Classic destination

In the classic destination, the “group id” specified in the Segment SDK call was ignored and you were required to set a trait where the key of the trait is the group key and the value of that trait is the group id. While that is no longer necessary, this behavior is supported in the Mixpanel (Actions) destination to ensure backwards-compatibility. If you specify a trait that matches specified group key, we will use the value of that trait as the group id.

Scenario 1: No group key trait specified

analytics.group("0e8c78ea9d97a7b8185e8632", {
  name: "Initech",
  industry: "Technology",
  employees: 329,
  plan: "enterprise",
  "total billed": 830
});

The group id that Mixpanel will use is 0e8c78ea9d97a7b8185e8632.

Scenario 2: Group key trait IS specified

analytics.group("0e8c78ea9d97a7b8185e8632", {
  $group_id: "12345",
  name: "Initech",
  industry: "Technology",
  employees: 329,
  plan: "enterprise",
  "total billed": 830
});

The group id that Mixpanel will use is 12345.

Track Event

Send an event to Mixpanel. Learn more about Events in Mixpanel

Track Event is a Cloud action. The default Trigger is:

type = "track"

Click to show / hide fields

Field Description
Event Name* Type: STRING

The name of the action being performed.

Distinct ID Type: STRING

A distinct ID specified by you.

Group ID Type: STRING

The unique identifier of the group that performed this event.

Timestamp Type: DATETIME

The timestamp of the event. If time is not sent with the event, it will be set to the time our servers receive it.

Event Properties Type: OBJECT

An object of key-value pairs that represent additional data to be sent along with the event.

User Properties Type: OBJECT

An object of key-value pairs that represent additional data tied to the user.

App Name Type: STRING

The name of your application

App Namespace Type: STRING

The namespace of your application.

App Build Type: STRING

The current build of your application.

App Version Type: STRING

The current version of your application.

OS Name Type: STRING

The name of the mobile operating system or browser that the user is using.

OS Version Type: STRING

The version of the mobile operating system or browser the user is using.

Device ID Type: STRING

A unique identifier for the device the user is using.

Device Type Type: STRING

The type of the user’s device

Device Name Type: STRING

The name of the user’s device

Device Manufacturer Type: STRING

The device manufacturer that the user is using.

Device Model Type: STRING

The device model that the user is using.

Bluetooth Enabled Type: BOOLEAN

Whether bluetooth is enabled

Carrier Type: STRING

The carrier that the user is using.

Cellular Enabled Type: BOOLEAN

Whether cellular is enabled

Wifi Type: BOOLEAN

Set to true if user’s device has an active, available Wifi connection, false if not.

Country Type: STRING

The current country of the user.

Region Type: STRING

The current region of the user.

Language Type: STRING

The language set by the user.

Library Name Type: STRING

The name of the SDK used to send events

Library Version Type: STRING

The version of the SDK used to send events

IP Address Type: STRING

The IP address of the user. This is only used for geolocation and won’t be stored.

Identifier For Advertiser (IDFA) Type: STRING

Identifier for Advertiser. (iOS)

UTM Properties Type: OBJECT

UTM Tracking Properties

URL Type: STRING

The full URL of the webpage on which the event is triggered.

Screen width Type: NUMBER

Width, in pixels, of the device screen.

Screen height Type: NUMBER

Height, in pixels, of the device screen.

Screen density Type: NUMBER

Pixel density of the device screen.

Referrer Type: STRING

Referrer url

User Agent Type: STRING

User agent

Identify User

Set the user ID for a particular device ID or update user properties. Learn more about User Profiles and Identity Management.

Identify User is a Cloud action. The default Trigger is:

type = "identify"

Click to show / hide fields

Field Description
User ID Type: STRING

The unique user identifier set by you

Anonymous ID Type: STRING

The generated anonymous ID for the user

User Properties Type: OBJECT

Properties to set on the user profile

Migration from Mixpanel Classic

Analytics.js 2.0

Actions-based destinations may require features found in Analytics.js 2.0. If the destination has Web actions and is connected to a javascript source, upgrade your Analytics.js source to ensure compatibility.

Assuming you’re already using Segment Cloud-mode, the Mixpanel (Actions) destination is expected to have no breaking changes when upgrading. With the exception of a few new properties added to your events in the new Actions destination, there should be no difference in the data received in Mixpanel when using either of the Mixpanel destinations.

If you want to confirm, you can configure the new destination to point to a different Mixpanel project and connect it to the same source(s) as the Classic destination and manually verify before fully switching over.

Contact Mixpanel support if you find features missing from the Mixpanel (Actions) destination that were available in the classic Mixpanel destination.

Mixpanel settings mapping

All
mixpanel Classic Destination Setting How to enable in mixpanel (Actions)

This page was last modified: 05 Jul 2022



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account