You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Breaking group analytics into 3 separate docs
Breaking up context into the main doc + 2 other docs (implementation + FAQ)
* Updating images and rewording
* Improved setup instructions in the implementation guide
* Update group-analytics-faq.md
* use mdx
* update link
Update links
---------
Co-authored-by: Myron Fung <[email protected]>
Co-authored-by: myronkaifung <[email protected]>
Copy file name to clipboardExpand all lines: pages/docs/data-structure/group-analytics.mdx
+9-149Lines changed: 9 additions & 149 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,15 +35,17 @@ Historically, Mixpanel grouped events by a single identifier called the distinct
35
35
></iframe>
36
36
</div>
37
37
38
-
### Group By a Custom Identifier
38
+
### Data Modeling
39
39
40
40
Mixpanel Group Analysis allows you to select alternative unique identifiers in reports.
41
41
42
-
By default, Mixpanel counts unique users by distinct_id. Group Analytics allows you to uniquely count events by an alternative identifier, such as company ID, invite ID, or another value shared by a group of individuals with different distinct_ids.
42
+
By default, Mixpanel counts unique users by distinct_id. Group Analytics allows you to uniquely count events by an alternative identifier, such as company ID, invite ID, or another value shared by a group of individuals with different distinct_ids. Below you will see an example of an event coming into a project that has `company_id` and `team_id` set up as separate group keys. You will see how, starting with a single event being ingested (on the left), by switching the identifier you're analyzing on, the event can be read with said identifier as the user key to do the analysis on:
43
+
44
+
<imgsrc="/group_analytics_data_model.png" />
43
45
44
46
This allows behavioral analysis from a business or group level, as opposed to an individual level. You can answer questions such as:
45
47
46
-
-What companies are engaging the most with a product?
48
+
-Which companies are engaging the most with a product?
47
49
- In instances where there are more than one user per account, such as a video streaming service, how are events triggered at an account level?
48
50
- What groups convert through a funnel to a goal event (as opposed to what individual users convert)?
49
51
@@ -59,17 +61,13 @@ The Group Profile also displays the properties unique to that group - here's an
59
61
60
62
To access a group profile:
61
63
62
-
1. Go to Users.
63
-
64
-
2. Click the **Analyze Uniques by** dropdown above the query builder.
4. Groups profiles will populate the Users report.
70
+
3. Groups profiles will populate the Users report.
73
71
74
72
### Change the Group Identifier in a Report
75
73
@@ -133,141 +131,3 @@ For example, in the below daily chart, we’re looking for activity qualificatio
133
131
The chart below shows that on Aug 19th, 35 accounts downloaded a document. Of the 35 accounts, 32 had one active user, 2 had two active users, and 1 had twenty-eight active users. Since most downloads originated from accounts with only one active user, we can conclude there is no correlation between account document downloaded activity and account health.
134
132
135
133

136
-
137
-
## Implementation
138
-
139
-
Establish the group identifier with an event property as the Group Key, where the property value is the Group ID. As **event property:value** is **group key:group id**.
140
-
141
-
### Group Keys in Project Settings
142
-
143
-
<Callouttype="info">
144
-
To set a group key, you must have an admin or owner project role. Learn more about [Roles and Permissions](/docs/orgs-and-projects/roles-and-permissions).
145
-
</Callout>
146
-
147
-
Group keys are project specific, and the group key must be set up before group data is sent.
148
-
149
-
To administer group keys, navigate to your Project Settings. Click **+Add Group Key** under the *Group Keys* section.
150
-
151
-

152
-
153
-
Enter an event property to attribute the group key to. You can also enter a display name for the group key. Click **Save**.
1. Choose which group key will be used as the B2B Company Key. This is the key for which Company Profiles (B2B Company Analytics) will be generated.
160
-
2. Specify the property that should be referenced as the Company name (identifier) throughout the Mixpanel interface.
161
-
162
-
<Callouttype="info">
163
-
You can change which group key should be used as the Company Key. To change, first unset the current group key set as Company Key in the project settings, and then set a new group key as the Company Key.
164
-
</Callout>
165
-
166
-

167
-
168
-
### Group Keys Tracked as Event Properties
169
-
170
-
**Group keys must be event properties.** All events need to have a defined group key on them in order to be attributed to a group. Property names and values are case-sensitive so be sure to track the group key on your events exactly as you've established them in Project Settings.
171
-
172
-
**Note:** Mixpanel does not backfill historical data to groups before the group key was implemented. This means that Mixpanel is only able to attribute group data from the date that the group key was set up in your Project Settings. Historical events that contain the group key as an event property sent prior to the implementation of the group key in Project Settings will not be attributed to a group.
173
-
174
-
### Attribute Events to Multiple Groups
175
-
176
-
An event can be attributed to multiple groups. To attribute to multiple groups, track the group event property's value as a list of string-valued group ids.
Not all of a user's events will be attributed to a group. Only the events with a defined group key will be attributed to the group and appear in the group's profile's activity feed.
183
-
184
-
### Implement Using the Groups API
185
-
186
-
Mixpanel's SDKs have methods to help you implement Groups Analytics.
187
-
188
-
Because the client has persistence, only client-side SDKs have methods for adding and removing a user's events to a group (registering and de-registering the `<group_key>: <group_id>` as a super property to be tracked on all events).
189
-
190
-
Without persistence on the server, you will need to track `<group_key>: <group_id>` on all events that should be attributed to a group (or multiple groups).
191
-
192
-
Both client- and server-side SDKs have methods for creating and updating Group Profiles.
193
-
194
-
To view the setup guides for implementing Groups using the Groups API, follow the instructions connected to the SDK you are using found in [Mixpanel's Developer Documentation](https://developer.mixpanel.com/docs).
It is possible to create Group Profiles by CSV upload as an alternative to the Groups API. [Follow the instructions here to learn how to upload Group Profiles using the Users report](/docs/data-structure/user-profiles#importing-from-csv).
209
-
210
-
### Add Group Key to User's Profile
211
-
212
-
Adding `<group_key>: <group_id>` to user profiles connects user profiles to group profiles. This allows you to view user group profile properties when analyzing by Users in reports; for example, when creating user cohorts based on group profile properties.
213
-
214
-
This relationship is one-way, meaning that you cannot use user profile properties when analyzing by a Group in reports.
215
-
216
-
Because a user can be part of multiple groups within a group key, set the value of the user property as a list of string values, i.e., `"company_id": ["1", "2"]`
217
-
218
-
## FAQ
219
-
220
-
### Limits
221
-
222
-
The limits below ensure group analytics works correctly in Mixpanel:
223
-
- 1M group profiles per group key (e.g. company_id)
224
-
- 1M events per day per group identifier (e.g. company_id = "Mixpanel") - see [Hot Shard Limits](/docs/tracking-best-practices/hot-shard-limits)
225
-
- Group properties have similar [limits as User properties](/docs/data-structure/user-profiles#what-are-the-limits-of-user-properties)
226
-
227
-
### Events Missing from Groups
228
-
The group key property must be present as an event property on an event in order to attribute them to a group profile.
229
-
230
-
Having the group key present as a user profile property does not automatically attribute the events by that user to the group.
231
-
232
-
Mixpanel does not backfill historical data to groups before the group key was implemented. This means that Mixpanel is only able to attribute group data from the date that the group key was set up in your Project Settings. Historical events that contain the group key as an event property sent prior to the implementation of the group key in Project Settings will not be attributed to a group.
233
-
234
-
### Group Analysis in Reports
235
-
Group properties are supported when analyzing by users, but user properties are not supported when analyzing by groups.
236
-
237
-
### Exporting Group Profiles via API
238
-
Use the [Engage API endpoint](https://developer.mixpanel.com/reference/engage-query) to export Group Profiles by adding `data_group_id` in the `data` param of the request.
The `<data_group_id>` for the respective group key's profile can be found under Group Keys within Project Settings:
250
-
251
-

252
-
253
-
Alternatively, the `<data_group_id>` can also be seen as part of the URL of the [Group Profile](/docs/data-structure/group-analytics#group-profiles) page:
Here's an actual [example](https://mixpanel.com/project/3187769/view/3699049/app/profile#distinct_id=company_id_8889&data_group_id=-1405123841946871899) with `data_group_id` = `-1405123841946871899`:
258
-
259
-

260
-
261
-
### How is B2B Company Analytics different than Group Analytics?
262
-
263
-
Company Analytics is an advanced offering ‘within’ group analytics.
264
-
265
-
Group Analytics focuses on the concept of there being multiple entities on which analysis can be done ‘independently’ (eg. user ID, restaurant ID, driver ID, company ID, etc.)
266
-
267
-
Company Analytics is specific to B2B Companies where you are likely to have a user ID and company ID. Here we focus on the idea that users ‘belong’ to a company, and that company behavior is ‘dependant’ on user behavioral activity. For instance, in SaaS companies, the health of an account is determined by how active the users of that account are.
268
-
269
-
### What are the unique features of B2B Company Analytics?
270
-
271
-
There are two features unique to B2B Company Analytics being set up, which aren’t available with the generic group analytics setup.
272
-
- Company Profiles - this is an advanced version of group profiles that shows you the health of a company
The limits below ensure group analytics works correctly in Mixpanel:
6
+
- 1M group profiles per group key (e.g. company_id)
7
+
- 1M events per day per group identifier (e.g. company_id = "Mixpanel") - see [Hot Shard Limits](/docs/tracking-best-practices/hot-shard-limits)
8
+
- Group properties have similar [limits as User properties](/docs/data-structure/user-profiles#what-are-the-limits-of-user-properties)
9
+
- The package supports up to 3 group keys. This can be increased up to 6 on enterprise plans with an add-on.
10
+
11
+
## Events Missing from Groups
12
+
The group key property must be present as an event property on an event in order to attribute them to a group profile.
13
+
14
+
Having the group key present as a user profile property does not automatically attribute the events by that user to the group.
15
+
16
+
Mixpanel does not backfill historical data to groups before the group key was implemented. This means that Mixpanel is only able to attribute group data from the date that the group key was set up in your Project Settings. Historical events that contain the group key as an event property sent prior to the implementation of the group key in Project Settings will not be attributed to a group.
17
+
18
+
## Group Analysis in Reports
19
+
Group properties are supported when analyzing by users, but user properties are not supported when analyzing by groups.
20
+
21
+
## Exporting Group Profiles via API
22
+
Use the [Engage API endpoint](https://developer.mixpanel.com/reference/engage-query) to export Group Profiles by adding `data_group_id` in the `data` param of the request.
The `<data_group_id>` for the respective group key's profile can be found under Group Keys within Project Settings:
34
+
35
+

36
+
37
+
Alternatively, the `<data_group_id>` can also be seen as part of the URL of the [Group Profile](/docs/data-structure/group-analytics#group-profiles) page:
Here's an actual [example](https://mixpanel.com/project/3187769/view/3699049/app/profile#distinct_id=company_id_8889&data_group_id=-1405123841946871899) with `data_group_id` = `-1405123841946871899`:
42
+
43
+

44
+
45
+
## How is B2B Company Analytics different than Group Analytics?
46
+
47
+
Company Analytics is an advanced offering ‘within’ group analytics.
48
+
49
+
Group Analytics focuses on the concept of there being multiple entities on which analysis can be done ‘independently’ (eg. user ID, restaurant ID, driver ID, company ID, etc.)
50
+
51
+
Company Analytics is specific to B2B Companies where you are likely to have a user ID and company ID. Here we focus on the idea that users ‘belong’ to a company, and that company behavior is ‘dependant’ on user behavioral activity. For instance, in SaaS companies, the health of an account is determined by how active the users of that account are.
52
+
53
+
## What are the unique features of B2B Company Analytics?
54
+
55
+
There are two features unique to B2B Company Analytics being set up, which aren’t available with the generic group analytics setup.
56
+
- Company Profiles - this is an advanced version of group profiles that shows you the health of a company
0 commit comments