Add group analytics to track workspace activity; replace setTag() call with setWorkspace() when adding workspace tag to person properties (#5519)

Signed-off-by: Abigail Dawson <abigaildawson.dev@gmail.com>
This commit is contained in:
Abigail Dawson
2024-05-06 16:23:06 +05:00
committed by GitHub
parent 096bfacad7
commit d99d0c6cbb
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -113,11 +113,11 @@ export async function connect (title: string): Promise<Client | undefined> {
)
console.log('logging in as guest')
Analytics.handleEvent('GUEST LOGIN')
Analytics.setTag('workspace', ws)
Analytics.setWorkspace(ws)
const me = await _client?.getAccount()
if (me !== undefined) {
Analytics.setUser(me.email)
Analytics.setTag('workspace', ws)
Analytics.setWorkspace(ws)
console.log('login: employee account', me)
setCurrentAccount(me)
}
+4 -4
View File
@@ -179,7 +179,7 @@ export async function createWorkspace (
const result = await response.json()
if (result.error == null) {
Analytics.handleEvent('create workspace')
Analytics.setTag('workspace', workspaceName)
Analytics.setWorkspace(workspaceName)
} else {
await handleStatusError('Create workspace error', result.error)
}
@@ -337,7 +337,7 @@ export async function selectWorkspace (workspace: string): Promise<[Status, Work
const result = await response.json()
if (result.error == null) {
Analytics.handleEvent('Select workspace')
Analytics.setTag('workspace', workspace)
Analytics.setWorkspace(workspace)
} else {
await handleStatusError('Select workspace error', result.error)
}
@@ -386,7 +386,7 @@ export async function fetchWorkspace (workspace: string): Promise<[Status, Works
const result = await response.json()
if (result.error == null) {
Analytics.handleEvent('Fetch workspace')
Analytics.setTag('workspace', workspace)
Analytics.setWorkspace(workspace)
} else {
await handleStatusError('Fetch workspace error', result.error)
}
@@ -433,7 +433,7 @@ export async function createMissingEmployee (workspace: string): Promise<[Status
const result = await response.json()
if (result.error == null) {
Analytics.handleEvent('Create missing employee')
Analytics.setTag('workspace', workspace)
Analytics.setWorkspace(workspace)
} else {
await handleStatusError('Fetch workspace error', result.error)
}