Skip to content

Commit e4ac7e4

Browse files
authored
Merge pull request #16780 from Budibase/chore/identify-creationtime-and-version
Identify creationtime and version on analytics
2 parents 3f1595b + 0c9790e commit e4ac7e4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

packages/backend-core/src/events/identification.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ const identifyInstallationGroup = async (
122122
const identifyTenantGroup = async (
123123
tenantId: string,
124124
hosting: Hosting,
125-
timestamp?: string | number
125+
timestamp: number,
126+
version = env.VERSION
126127
): Promise<void> => {
127128
const id = await getEventTenantId(tenantId)
128129
const type = IdentityType.TENANT
@@ -135,6 +136,8 @@ const identifyTenantGroup = async (
135136
hosting,
136137
environment,
137138
installationId,
139+
createdAt: timestamp,
140+
createdVersion: version,
138141
}
139142

140143
await identifyGroup(group, timestamp)

packages/types/src/sdk/events/identification.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export interface TenantGroup extends Group {
1919
// as we don't have this at the user level
2020
profession?: string // only available in cloud
2121
companySize?: string // only available in cloud
22+
createdAt?: string | number
23+
createdVersion: string
2224
installationId: string
2325
}
2426

packages/worker/src/api/controllers/global/users.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ export const adminUser = async (
250250

251251
await events.identification.identifyTenantGroup(
252252
tenantId,
253-
env.SELF_HOSTED ? Hosting.SELF : Hosting.CLOUD
253+
env.SELF_HOSTED ? Hosting.SELF : Hosting.CLOUD,
254+
Date.now()
254255
)
255256

256257
ctx.body = {

0 commit comments

Comments
 (0)