Skip to content

Commit

Permalink
Migrate to posthog
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jun 26, 2024
1 parent d5db184 commit a4d26e1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
14 changes: 10 additions & 4 deletions apps/app/layout/app.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@
import { setHardwareInfo, hardwareInfo } from "ui/stores/hardwareInfo"
import DesktopLoading from "ui/navigation/desktopLoading.svelte"
import { generateMinutesData, generateSecondsData } from "ui/utils/stats"
import { init as initAnalytics, trackEvent } from "@aptabase/web"
import build from "../../../build.json"
import DesktopNavigation from "ui/navigation/desktopNavigation.svelte"
import { invoke } from "@tauri-apps/api/core"
import { check } from "@tauri-apps/plugin-updater"
import { relaunch } from "@tauri-apps/plugin-process"
import { ask } from "@tauri-apps/plugin-dialog"
initAnalytics("A-EU-8117718240", { appVersion: build.version })
import posthog from "posthog-js"
onMount(async () => {
let sendAnalytics = true
Expand Down Expand Up @@ -156,9 +154,17 @@
const analytics = async () => {
if (sendAnalytics && !build.dev) {
posthog.init("phc_2zbUPXXhnelCYP2VLXeWZvKy0hykzQA7edSOsFrYZaa", {
api_host: "https://eu.i.posthog.com",
capture_pageview: false,
capture_pageleave: false,
persistence: "localStorage",
autocapture: false,
})
const systemInfo: SystemInfo = await invoke("system_info")
trackEvent("hardware_info", {
posthog.capture("hardware_info", {
version: build.version,
build: build.number,
cpu: systemInfo.cpuName,
Expand Down
4 changes: 2 additions & 2 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"vite": "^5.0.12"
},
"dependencies": {
"@aptabase/web": "^0.4.2",
"@tauri-apps/api": "^2.0.0-beta.9",
"@tauri-apps/plugin-dialog": "^2.0.0-beta.2",
"@tauri-apps/plugin-process": "^2.0.0-beta.3",
"@tauri-apps/plugin-shell": "^2.0.0-beta.2",
"@tauri-apps/plugin-updater": "^2.0.0-beta.3"
"@tauri-apps/plugin-updater": "^2.0.0-beta.3",
"posthog-js": "^1.141.3"
}
}
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
},
"dependencies": {
"ezrtc": "^0.6.0",
"posthog-js": "^1.136.7"
"posthog-js": "^1.141.3"
}
}
26 changes: 14 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a4d26e1

Please sign in to comment.