Users belonging to multiple companies
Updated over a week ago

Why are you seeing this?

We show this banner in your People list if we find that your users belong to multiple companies in your app without having their events associated with a specific company.

The cause

This happens when:

  1. Users can log into multiple workspaces. Example: In Slack you can belong to multiple communities (workspace).

  2. Employees can connect to your customers' accounts. It's possible that you have an "impersonation" workflow in your app where you add yourself to a company to debug an issue or onboard a customer, and end up associating yourself to that company in June.

The problem

When you don't associate a user's events to a specific company, we have no way of knowing which company the user performed that action in.

As a result, we over estimate your number of active companies because we end up counting every company (a user belongs to) as active.

The solution

1. Users can log into multiple workspaces

If users in your app can belong to multiple companies (for example, if your product is similar to Slack or GitHub), you should use the group context to associate their events to the company in which they're performing them.

To do so, send the unique identifier of that company as a groupId in the context of your track calls.
​
​


​
​Docs for Segment's SDK πŸ‘‰https://segment.com/docs/connections/spec/b2b-saas/
​
​

An example from our SDK docs:

# python

analytics.track(
user_id="019mr8mf4r",
event="Created Account",
properties={"plan": "Pro"},
context={"groupId": "56"},
)

2. Employees can connect to your customers' accounts

Whenever you add yourself to your customers' accounts, don't send IDENTIFY, TRACK and GROUP calls. After you do that, you should go ahead and delete all your internal users so that every track event, identify call and group call will be deleted. Here's how you can programmatically delete users. Alternatively, you can do this from the user profile of the user directly.

# python

def internal_user():
# check if the current_user is a teammate
return '@your.domain' in current_user.email

def your_app():
# check if the current app is your own app
return request_params['app_id'] == YOUR_APP_ID

# tracking calls

def analytics_identify():
# do not identify if a teammate is part of another app
return if internal_user() and !your_app()

analytics.identify(
user_id="019mr8mf4r",
)

def analytics_group():
# do not group if a teammate is part of another app
return if internal_user() and !your_app()

analytics.group(
group_id="A",
user_id="019mr8mf4r",
)

def analytics_track():
# do not track if a teammate is part of another app
return if internal_user() and !your_app()

analytics_track(
name="signed_up",
user_id="019mr8mf4r",
context={ "groupId": "A" }
)

Did this answer your question?