feat: add page view to telemetry
This commit is contained in:
@@ -91,3 +91,11 @@ export function logHoppRequestRunToAnalytics(ev: HoppRequestEvent) {
|
|||||||
analytics.logEvent("hopp-request", ev)
|
analytics.logEvent("hopp-request", ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function logPageView(pagePath: string) {
|
||||||
|
if (settingsStore.value.TELEMETRY_ENABLED) {
|
||||||
|
analytics.logEvent("page_view", {
|
||||||
|
page_path: pagePath,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,8 +20,14 @@ import { initUserInfo } from "~/helpers/teams/BackendUserInfo"
|
|||||||
import { registerApolloAuthUpdate } from "~/helpers/apollo"
|
import { registerApolloAuthUpdate } from "~/helpers/apollo"
|
||||||
import { initializeFirebase } from "~/helpers/fb"
|
import { initializeFirebase } from "~/helpers/fb"
|
||||||
import { getSettingSubject } from "~/newstore/settings"
|
import { getSettingSubject } from "~/newstore/settings"
|
||||||
|
import { logPageView } from "~/helpers/fb/analytics"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
watch: {
|
||||||
|
$route(to) {
|
||||||
|
logPageView(to.fullPath)
|
||||||
|
},
|
||||||
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
registerApolloAuthUpdate()
|
registerApolloAuthUpdate()
|
||||||
|
|
||||||
@@ -35,7 +41,6 @@ export default {
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
performMigrations()
|
performMigrations()
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
"%cWe ❤︎ open source!",
|
"%cWe ❤︎ open source!",
|
||||||
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
|
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
|
||||||
@@ -71,6 +76,8 @@ export default {
|
|||||||
|
|
||||||
initializeFirebase()
|
initializeFirebase()
|
||||||
initUserInfo()
|
initUserInfo()
|
||||||
|
|
||||||
|
logPageView(this.$router.currentRoute.fullPath)
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
document.removeEventListener("keydown", this._keyListener)
|
document.removeEventListener("keydown", this._keyListener)
|
||||||
|
|||||||
Reference in New Issue
Block a user