We are having an issue with account-level tracking.
Our product is similar to other products like Notion or Slack, where a user can be part of multiple workspaces, and has different permission levels in each of those workspaces.
What we’re trying to accomplish
Every time a user does something in Workspace X, we want to track the event as belonging to Workspace X. When they do something in Workspace Y, we want to track the event as belonging to Workspace Y.
The same goes for permissions: when a user does something as an Admin in Workspace X, we want the permission level to be a property of the event. And when they do something as a member of Workspace Y, we want the member permission to be a property of the event.
The problem
Normally, this would be easy - we would just call group whenever a user switches to a new workspace and call Identify whenever their permission level changes. But that’s harder than it seems.
For example, imagine that a user works in Workspace X, then one day they open a link to Workspace Y. Because the user never actually switched workspace, we will continue tracking their events as if they belong to workspace X.
Any suggestions for how to track this properly? There are many similar products out there that use this type of workspace paradigm - Slack, Notion, Coda, and many more. Surely there is a standard way to track this properly?