Skip to content

Commit 355c424

Browse files
Argenisf group analytics rewrite 2025 (#2174)
* 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]>
1 parent 1d1a686 commit 355c424

File tree

8 files changed

+192
-149
lines changed

8 files changed

+192
-149
lines changed

pages/docs/data-structure/group-analytics.mdx

Lines changed: 9 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,17 @@ Historically, Mixpanel grouped events by a single identifier called the distinct
3535
></iframe>
3636
</div>
3737

38-
### Group By a Custom Identifier
38+
### Data Modeling
3939

4040
Mixpanel Group Analysis allows you to select alternative unique identifiers in reports.
4141

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+
<img src="/group_analytics_data_model.png" />
4345

4446
This allows behavioral analysis from a business or group level, as opposed to an individual level. You can answer questions such as:
4547

46-
- What companies are engaging the most with a product?
48+
- Which companies are engaging the most with a product?
4749
- 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?
4850
- What groups convert through a funnel to a goal event (as opposed to what individual users convert)?
4951

@@ -59,17 +61,13 @@ The Group Profile also displays the properties unique to that group - here's an
5961

6062
To access a group profile:
6163

62-
1. Go to Users.
63-
64-
2. Click the **Analyze Uniques by** dropdown above the query builder.
64+
1. Navigate to the Users page from the menu.
6565

66-
![/Screen_Shot_2022-06-22_at_5.40.43_PM.png](/Screen_Shot_2022-06-22_at_5.40.43_PM.png)
66+
2. Click on the group identifier you want to analyze on.
6767

68-
3. Select the group identifier.
68+
![/group_analytics_navigation.png](/group_analytics_navigation.png)
6969

70-
![/Screen_Shot_2022-06-22_at_5.39.06_PM.png](/Screen_Shot_2022-06-22_at_5.39.06_PM.png)
71-
72-
4. Groups profiles will populate the Users report.
70+
3. Groups profiles will populate the Users report.
7371

7472
### Change the Group Identifier in a Report
7573

@@ -133,141 +131,3 @@ For example, in the below daily chart, we’re looking for activity qualificatio
133131
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.
134132

135133
![image](/B2B_Activation_2.webp)
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-
<Callout type="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-
![image](/add-group-key.png "Add Group Key")
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**.
154-
155-
![/Screen_Shot_2022-06-22_at_6.18.38_PM.png](/Screen_Shot_2022-06-22_at_6.18.38_PM.png)
156-
157-
### Setup B2B Company Key
158-
159-
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-
<Callout type="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-
![image](/B2B_Company_Key.webp)
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.
177-
178-
```javascript
179-
mixpanel.track("Some Event", { company_id: ["01234", "56789", "55555"] });
180-
```
181-
182-
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).
195-
196-
- [HTTP](https://developer.mixpanel.com/docs/http#section-group-analytics)
197-
- [Javascript SDK](https://developer.mixpanel.com/docs/javascript#section-group-analytics)
198-
- [iOS-Swift SDK](https://developer.mixpanel.com/docs/swift#section-group-analytics)
199-
- [iOS-Objective-C SDK](https://developer.mixpanel.com/docs/ios#section-group-analytics)
200-
- [Android SDK](https://developer.mixpanel.com/docs/android#section-group-analytics)
201-
- [Java SDK](https://developer.mixpanel.com/docs/java#section-group-analytics)
202-
- [Python SDK](https://developer.mixpanel.com/docs/python#section-group-analytics)
203-
- [React Native SDK](https://developer.mixpanel.com/docs/react-native#group-analytics)
204-
- [Ruby SDK](https://developer.mixpanel.com/docs/ruby#section-group-analytics)
205-
206-
### Upload Group Profiles Using the Users Report
207-
208-
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.
239-
240-
```
241-
curl --request POST \
242-
--url https://eu.mixpanel.com/api/2.0/engage \
243-
--header 'Authorization: Basic <redacted>' \
244-
--header 'Content-Type: application/x-www-form-urlencoded' \
245-
--data 'filter_by_cohort={"id": <cohort_id_here>}' \
246-
--data data_group_id=<data_group_id_here>
247-
```
248-
249-
The `<data_group_id>` for the respective group key's profile can be found under Group Keys within Project Settings:
250-
251-
![image](/data-group-id.png "Data Group ID")
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:
254-
255-
`https://mixpanel.com/project/<project_id>/view/<workspace_id>/app/profile#distinct_id=<distinct_id>&data_group_id=<data_group_id>`
256-
257-
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-
![image](/engage-api-data-group-id.png "Engage API Data Group ID")
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
273-
- Company Activation filters & breakdowns
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
"group-analytics-implementation": "Implementation",
3+
"group-analytics-faq": "FAQ"
4+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Group Analytics FAQ
2+
3+
## Limits
4+
5+
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.
23+
24+
```
25+
curl --request POST \
26+
--url https://eu.mixpanel.com/api/2.0/engage \
27+
--header 'Authorization: Basic <redacted>' \
28+
--header 'Content-Type: application/x-www-form-urlencoded' \
29+
--data 'filter_by_cohort={"id": <cohort_id_here>}' \
30+
--data data_group_id=<data_group_id_here>
31+
```
32+
33+
The `<data_group_id>` for the respective group key's profile can be found under Group Keys within Project Settings:
34+
35+
![image](/data-group-id.png "Data Group ID")
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:
38+
39+
`https://mixpanel.com/project/<project_id>/view/<workspace_id>/app/profile#distinct_id=<distinct_id>&data_group_id=<data_group_id>`
40+
41+
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+
![image](/engage-api-data-group-id.png "Engage API Data Group ID")
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
57+
- Company Activation filters & breakdowns

0 commit comments

Comments
 (0)