diff --git a/packages/frontend-2/lib/core/composables/mp.ts b/packages/frontend-2/lib/core/composables/mp.ts index 3f0aba0bc9..721e6173df 100644 --- a/packages/frontend-2/lib/core/composables/mp.ts +++ b/packages/frontend-2/lib/core/composables/mp.ts @@ -40,6 +40,7 @@ export function useMixpanelUserIdentification() { const mp = useMixpanel() const { distinctId } = useActiveUser() const { isDarkTheme } = useTheme() + const serverId = getMixpanelServerId() return { reidentify: () => { @@ -49,7 +50,7 @@ export function useMixpanelUserIdentification() { // Register session mp.register({ // eslint-disable-next-line camelcase - server_id: getMixpanelServerId(), + server_id: serverId, hostApp: HOST_APP }) @@ -58,6 +59,7 @@ export function useMixpanelUserIdentification() { mp.identify(distinctId.value) mp.people.set('Identified', true) mp.people.set('Theme Web', isDarkTheme.value ? 'dark' : 'light') + mp.add_group('server_id', serverId) } } } diff --git a/packages/frontend/src/mixpanelManager.ts b/packages/frontend/src/mixpanelManager.ts index 0045f9ba83..04e2e993d6 100644 --- a/packages/frontend/src/mixpanelManager.ts +++ b/packages/frontend/src/mixpanelManager.ts @@ -69,8 +69,9 @@ export function initialize(params: { const { hostApp, hostAppDisplayName } = params // Register session + const serverId = getMixpanelServerId() mp.register({ - server_id: getMixpanelServerId(), + server_id: serverId, hostApp }) @@ -80,6 +81,7 @@ export function initialize(params: { mp.identify(userId) mp.people.set('Identified', true) mp.people.set('Theme Web', ThemeStateManager.isDarkTheme() ? 'dark' : 'light') + mp.add_group('server_id', serverId) } // Track UTM