1
0
Fork 0
mirror of synced 2024-06-27 18:40:42 +12:00

Merge pull request #7145 from Budibase/disable-posthog-pageview

Disable pageview event
This commit is contained in:
Rory Powell 2022-08-08 15:03:17 +01:00 committed by GitHub
commit 06e0c3a18a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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.