feat: add analytics logging while hoppscotch requests are fired

This commit is contained in:
Andrew Bastin
2021-07-05 20:02:29 -04:00
parent 913b073ba4
commit 86bd4aa568
8 changed files with 70 additions and 2 deletions

View File

@@ -13,6 +13,13 @@ type SettingsCustomDimensions = {
syncHistory: boolean
}
type HoppRequestEvent =
| {
platform: "rest" | "graphql-query" | "graphql-schema"
strategy: "normal" | "proxy" | "extension"
}
| { platform: "wss" | "sse" | "socketio" | "mqtt" }
export function initAnalytics() {
analytics = firebase.app().analytics()
@@ -46,3 +53,7 @@ function initSettingsListeners() {
})
})
}
export function logHoppRequestRunToAnalytics(ev: HoppRequestEvent) {
analytics.logEvent("hopp-request", ev)
}