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
Full context in this slack thread. Here's a summary:
Calling posthog.group() has a side-effect where subsequent events that captured are associated to the group.
This is fine if you have a high-level group type like company, since you probably want all the users events to be associated with the company.
However, for lower-level group types (e.g. project in an Asana-like app), you dont want ALL subsequent events to be associated with the group. Instead, you want to explicitly specify which events should be capture (see reason for this below)
@neilkakkar suggested to set the groups property in events to associate events e.g. posthog.capture('new_task_created, { $groups: { project: <project_id> }. This doesnt work as expected . See below for more
Also, if you try to set group properties by manually capturing$groupidentify, all subsequent events are still associated with the group.
Full context in this slack thread. Here's a summary:
posthog.group()
has a side-effect where subsequent events that captured are associated to the group.company
, since you probably want all the users events to be associated with the company.project
in an Asana-like app), you dont want ALL subsequent events to be associated with the group. Instead, you want to explicitly specify which events should be capture (see reason for this below)groups
property in events to associate events e.g.posthog.capture('new_task_created, { $groups: { project: <project_id> }
. This doesnt work as expected . See below for more$groupidentify
, all subsequent events are still associated with the group.e.g. if you call:
In the above, all subsequent client-side events are then associated with the project.
Why you might not want all subsequent events to be associated with the group
Consider the following scenario:
Why
posthog.capture('new_task_created, { $groups: { project: <project_id> }
doesnt workSetting the $groups key will override any previous
posthog.group()
calls. For example:posthog.group('company', <company_id>)
posthog.capture('new_task_created, { $groups: { project: <project_id> }
Expected result:
Your event is captured with both the project and the company
Actual result:
Event is only captured with the project. The company is dropped
The text was updated successfully, but these errors were encountered: