FEATURE: analytics client now scrape user email and room group

This commit is contained in:
Kharhamel 2021-09-30 16:14:55 +02:00
parent d0c0f3e7fc
commit 726f52976d
7 changed files with 20 additions and 8 deletions

View file

@ -19,10 +19,10 @@ class AnalyticsClient {
}
}
identifyUser(uuid: string) {
identifyUser(uuid: string, email: string | null) {
this.posthogPromise
.then((posthog) => {
posthog.identify(uuid, { uuid, wa: true });
posthog.identify(uuid, { uuid, email, wa: true });
})
.catch();
}
@ -43,10 +43,10 @@ class AnalyticsClient {
.catch();
}
enteredRoom(roomId: string) {
enteredRoom(roomId: string, roomGroup: string | null) {
this.posthogPromise
.then((posthog) => {
posthog.capture("$pageView", { roomId });
posthog.capture("$pageView", { roomId, roomGroup });
})
.catch();
}