1
0
Fork 0
mirror of synced 2024-06-14 00:14:39 +12:00

Disable pageview event

This commit is contained in:
Rory Powell 2022-08-08 12:28:39 +01:00
parent b894405f8e
commit c11df5d170
2 changed files with 1 additions and 14 deletions

View file

@ -1,7 +1,5 @@
import posthog from "posthog-js"
import { Events } from "./constants"
import { get } from "svelte/store"
import { admin } from "../stores/portal"
export default class PosthogClient {
constructor(token) {
@ -11,15 +9,9 @@ export default class PosthogClient {
init() {
if (!this.token) return
// enable page views in cloud only
let capturePageViews = false
if (get(admin).cloud) {
capturePageViews = true
}
posthog.init(this.token, {
autocapture: false,
capture_pageview: capturePageViews,
capture_pageview: false,
})
posthog.set_config({ persistence: "cookie" })

View file

@ -139,11 +139,6 @@ export function createAuthStore() {
await setOrganisation(tenantId)
},
getSelf: async () => {
// for analytics, we need to make sure the environment has been loaded
// before setting the user
if (!get(admin).loaded) {
await admin.init()
}
// We need to catch this locally as we never want this to fail, even
// though normally we never want to swallow API errors at the store level.
// We're either logged in or we aren't.