Skip to content

Commit 2cdcb66

Browse files
authored
Merge pull request #7964 from segmentio/mixpanel-screenshot
Added screenshot of mapping in Segment UI to Mixpanel docs [DOC-1275]
2 parents cc52a18 + 43d7a2f commit 2cdcb66

File tree

2 files changed

+31
-24
lines changed

2 files changed

+31
-24
lines changed
65.5 KB
Loading

src/connections/destinations/catalog/actions-mixpanel/index.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ redirect_from:
1313
{% include content/plan-grid.md name="actions" %}
1414

1515

16-
[Mixpanel](https://mixpanel.com/){:target='_blank'} enables you to build better products through powerful, self-serve product analytics to help you convert, engage, and retain more users.
16+
[Mixpanel](https://mixpanel.com/){:target='_blank'} lets you build better products through powerful, self-serve product analytics to help you convert, engage, and retain more users.
1717

1818

1919
## Benefits of Mixpanel (Actions) vs Mixpanel Classic
@@ -29,23 +29,21 @@ Mixpanel (Actions) provides the following benefits over the classic Mixpanel des
2929
## Getting started
3030

3131
1. Go to your [Mixpanel project settings](https://mixpanel.com/report/settings/#account/projects){:target='_blank'}. Copy the Mixpanel API Key and API Secret for your project.
32-
2. From the Segment web app, click **Catalog**, then click **Destinations**.
33-
3. Find the Destinations Actions item in the left navigation, and click it.
34-
4. Click the "Mixpanel" item to select it and click **Configure**.
35-
5. Choose which of your sources to connect the destination to. (You can connect more sources to the destination later.)
32+
2. In the your Segment workspace, click **Catalog**, then click **Destinations**.
33+
3. Navigate to **Destinations Actions**, select "Mixpanel", then click **Add destination**.
34+
4. Choose which of your sources to connect the destination to. (You can connect more sources to the destination later.)
3635

37-
### Connection Modes for Mixpanel (Actions) destination
36+
### Connection modes for Mixpanel (Actions) destination
3837

39-
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](/docs/connections/sources/catalog/libraries/website/javascript/), [Swift](https://github.com/segmentio/analytics-swift){:target="_blank”} or [Kotlin](https://github.com/segmentio/analytics-kotlin){:target="_blank”}) with the Actions-framework version of the destination, you do not need the device-mode connection.
38+
The Mixpanel (Actions) destination does not offer a device-mode connection mode. If you're using one of Segment's libraries ([Analytics.js 2.0](/docs/connections/sources/catalog/libraries/website/javascript/), [Swift](https://github.com/segmentio/analytics-swift){:target="_blank”} or [Kotlin](https://github.com/segmentio/analytics-kotlin){:target="_blank”}) with the Actions-framework version of the destination, you do not need the device-mode connection.
4039

4140
{% capture track_purchase_details %}
4241

43-
When set `Generate Purchase Event Per Product` to `true`, this setting effectively "flattens" the array of objects in the `Order Completed`'s `products` property by tracking a `Product Purchased` event for each item in the array. This enables more sophisticated analysis on a per-product basis in Mixpanel. These `Product Purchased` events will contain all of the key-value pairs from their respective object in the `products` array as event properties, along with the `order_id` and `checkout_id` from the `Order Completed` event.
42+
When `Generate Purchase Event Per Product` is set to `true`, this setting effectively "flattens" the array of objects in the `Order Completed`'s `products` property by tracking a `Product Purchased` event for each item in the array. This enables a more sophisticated analysis on a per-product basis in Mixpanel. These `Product Purchased` events will contain all of the key-value pairs from their respective object in the `products` array as event properties, along with the `order_id` and `checkout_id` from the `Order Completed` event.
4443

4544
{% endcapture %}
4645

4746

48-
4947
{% capture group_identify_user_details %}
5048

5149

@@ -56,24 +54,24 @@ In the default configuration, Mixpanel (Actions) triggers this action when it re
5654
5755
This action sets or updates the properties of specific groups. Use this when you want to update properties on a [group profile](https://help.mixpanel.com/hc/en-us/articles/360025333632-Group-Analytics#group-profiles){:target='_blank'}.
5856

59-
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.
57+
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.
6058

6159
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`.
6260

6361
### Default group key
6462
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.
6563

66-
1. Go to your [Mixpanel project](https://mixpanel.com/report){:target='_blank'} settings
64+
1. Go to your [Mixpanel project](https://mixpanel.com/report){:target='_blank'} settings.
6765
2. Scroll to the "Group Keys" section. If this section doesn't exist, you may not have the Group Analytics add-on.
6866
3. Create the new group key:
6967

70-
![Set Group Key](./images/set-group-key.gif)
68+
![GIF demonstrating how to set Group key in Mixpanel UI](./images/set-group-key.gif)
7169

7270
### Using a different group key
7371
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.
7472

7573
### Backwards-compatibility with Mixpanel Classic destination
76-
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, Mixpanel uses the value of that trait as the group id.
74+
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, Mixpanel uses the value of that trait as the group ID.
7775

7876
#### Scenario 1: No group key trait specified
7977
```js
@@ -85,7 +83,7 @@ analytics.group("0e8c78ea9d97a7b8185e8632", {
8583
"total billed": 830
8684
});
8785
```
88-
The group id that Mixpanel will use is `0e8c78ea9d97a7b8185e8632`.
86+
The group ID that Mixpanel will use is `0e8c78ea9d97a7b8185e8632`.
8987

9088
#### Scenario 2: Group key trait IS specified
9189
```js
@@ -98,7 +96,7 @@ analytics.group("0e8c78ea9d97a7b8185e8632", {
9896
"total billed": 830
9997
});
10098
```
101-
The group id that Mixpanel will use is `12345`.
99+
The group ID that Mixpanel will use is `12345`.
102100

103101
> success ""
104102
> The below special traits will be mapped to Mixpanel reserved properties automatically to fit Mixpanel's use cases. `traits.name` -> `$name`.
@@ -107,7 +105,16 @@ The group id that Mixpanel will use is `12345`.
107105

108106
{% capture identify_user_details %}
109107
> success ""
110-
> Segment maps the userId set in the identify event to the distinct ID in Mixpanel. Segment also maps the following traits to Mixpanel reserved properties to fit Mixpanel's use cases: `traits.created` -> `$created`, `traits.email` -> `$email`, `traits.firstName` -> `$first_name`, `traits.lastName` -> `$last_name`, `traits.name` -> `$name`, `traits.username` -> `$username` and `traits.phone` -> `$phone`.
108+
> Segment maps the userId set in the Identify event to the distinct ID in Mixpanel.
109+
>
110+
> Segment also maps the following traits to Mixpanel reserved properties to fit Mixpanel's use cases: `traits.created` -> `$created`, `traits.email` -> `$email`, `traits.firstName` -> `$first_name`, `traits.lastName` -> `$last_name`, `traits.name` -> `$name`, `traits.username` -> `$username` and `traits.phone` -> `$phone`.
111+
>
112+
> For more detail, see Mixpanel's documentation on [Reserved Properties](https://docs.mixpanel.com/docs/data-structure/property-reference/reserved-properties){:target="_blank"}.
113+
114+
##### Example
115+
For example, if you map `traits.email` to Mixpanel, Segment automatically transforms this into Mixpanel's reserved property `$email`.
116+
117+
![Screenshot of mapping traits.email from Segment to Mixpanel email field, which Segment transforms to $email](./images/traits-mapping-screenshot.png)
111118

112119
{% endcapture %}
113120

@@ -123,33 +130,33 @@ Assuming you're already using Segment Cloud-mode, the Mixpanel (Actions) destina
123130
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.
124131

125132
> info ""
126-
> Contact Mixpanel support if you find features missing from the Mixpanel (Actions) destination that were available in the classic Mixpanel destination.
133+
> Contact [Mixpanel support](https://mixpanel.com/contact-us/support/){:target="_blank"} if you find features missing from the Mixpanel (Actions) destination that were available in the classic Mixpanel destination.
127134
128135
{% include components/actions-map-table.html name="mixpanel" %}
129136

130137
## Troubleshooting
131138

132-
### Track events are not attributed to Mixpanel Groups
139+
#### Track events are not attributed to Mixpanel Groups
133140

134-
If the Mixpanel (Actions) destination uses $group_id as the group key, ensure that the mappings handling your `track` events have the field for **Group ID** mapped to a valid value. By default, this field maps to the event variable `context.groupId`.
141+
If the Mixpanel (Actions) destination uses `$group_id` as the group key, ensure that the mappings handling your `track` events have the field for **Group ID** mapped to a valid value. By default, this field maps to the event variable `context.groupId`.
135142

136-
To send Track events with a custom Group Key, include the key as a property of Track events. For example:
143+
To send Track events with a custom Group key, include the key as a property of Track events. For example:
137144
```js
138145
analytics.track('Example Event', { custom_group_key : 'group1' });
139146
```
140-
### Failed events due to timestamp
147+
#### Failed events due to timestamp
141148

142149
If your integration is correct and you are still seeing failed events, review and verify that you are sending all date properties as UTC time format, due to Mixpanel timestamp format requirements.
143150

144-
### Failed events due to messageId
151+
#### Failed events due to messageId
145152
Segment maps the `messageId` of a Segment event to Mixpanel's `insert_id` value. If you are generating your own `messageId`, ensure the format complies with Mixpanel's `insert_id` requirements. For more information, see Mixpanel's [Import Events](https://developer.mixpanel.com/reference/import-events#propertiesinsert_id){:target="_blank”} documentation.
146153

147154
Failing to generate a `messageId` that complies with Mixpanel's `insert_id` standard might result in a `400 Bad Request` error from Mixpanel.
148155

149-
### Why is Boardman, Oregon appearing in my users' profile location field?
156+
#### Why is Boardman, Oregon appearing in my users' profile location field?
150157

151158
If you are seeing traffic from Boardman or see Segment as the browser, you might be sending server side calls to your Mixpanel (Actions) destination. To correctly populate your users' profile location field, manually pass the IP information in the context object from the server.
152159

153160

154-
### Why is the Operating System field empty in Mixpanel?
161+
#### Why is the Operating System field empty in Mixpanel?
155162
Mixpanel captures the `Operating System` field from the "OS Name" field in Segment. For Analytics.js sources, ensure that `context.userAgentData.platform` is correctly mapped to the "OS Name" field in your destination mappings. If this mapping is missing or misconfigured, the Operating System field may appear empty in Mixpanel.

0 commit comments

Comments
 (0)