mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 09:48:44 +00:00
add posthog to existing events wrapper
This commit is contained in:
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,
|
||||
|
||||
Reference in new issue
Block a user