add posthog to existing events wrapper

This commit is contained in:
Brandon Thomas committed 2023-07-24 04:42:42 -04:00
1 parent 341b7edd34
commit 1e20ae153e
2 files changed
+6

No files matched your search

@@ -44,10 +44,12 @@ export class SessionWrapper {
return this.sessionStateResponse?.logged_in || false;
}
// Username is all lowercase
public getUsername() : string | undefined {
return this.sessionStateResponse?.user?.username;
}
// Display name has capitalization
public getDisplayName() : string | undefined {
return this.sessionStateResponse?.user?.display_name;
}
@@ -1,3 +1,5 @@
import posthog from 'posthog-js'
/**
* Send Analytics to Google Analytics.
*
@@ -282,6 +284,8 @@ class Analytics {
}
private static sendCategorizedEvent(eventCategory: string, actionName: string, eventLabel?: string, value?: number) {
posthog.capture(actionName);
gtag('event', actionName, {
'event_category': eventCategory,
'event_label': eventLabel,