You've already forked AstralRinth
forked from didirus/AstralRinth
Switch to PostHog for app analytics (#2316)
This commit is contained in:
23
apps/app-frontend/src/helpers/analytics.js
Normal file
23
apps/app-frontend/src/helpers/analytics.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { posthog } from 'posthog-js'
|
||||
|
||||
export const initAnalytics = () => {
|
||||
posthog.init('phc_hm2ihMpTAoE86xIm7XzsCB8RPiTRKivViK5biiHedm', {
|
||||
persistence: 'localStorage',
|
||||
})
|
||||
}
|
||||
|
||||
export const debugAnalytics = () => {
|
||||
posthog.debug()
|
||||
}
|
||||
|
||||
export const optOutAnalytics = () => {
|
||||
posthog.opt_out_capturing()
|
||||
}
|
||||
|
||||
export const optInAnalytics = () => {
|
||||
posthog.opt_in_capturing()
|
||||
}
|
||||
|
||||
export const trackEvent = (eventName, properties) => {
|
||||
posthog.capture(eventName, properties)
|
||||
}
|
||||
Reference in New Issue
Block a user