Skip to content

Commit

Permalink
feat: add users to groups (#1748)
Browse files Browse the repository at this point in the history
* feat: add users to groups

* feat(fe2): add users to groups
  • Loading branch information
teocomi authored Aug 8, 2023
1 parent e019864 commit 6a5419c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/frontend-2/lib/core/composables/mp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function useMixpanelUserIdentification() {
const mp = useMixpanel()
const { distinctId } = useActiveUser()
const { isDarkTheme } = useTheme()
const serverId = getMixpanelServerId()

return {
reidentify: () => {
Expand All @@ -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
})

Expand All @@ -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)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend/src/mixpanelManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

Expand All @@ -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
Expand Down

0 comments on commit 6a5419c

Please sign in to comment.