diff options
| author | Fuwn <[email protected]> | 2026-05-29 23:05:37 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-05-29 23:05:37 +0000 |
| commit | be151fd6f7e7860cc60bee67bab815c155e86fcd (patch) | |
| tree | 47dcfe80450479efe722f4b59c58f934d07f3618 /src/lib/CommandPalette/authActions.ts | |
| parent | feat(lists): animate list-title count with NumberTicker (diff) | |
| download | due.moe-be151fd6f7e7860cc60bee67bab815c155e86fcd.tar.xz due.moe-be151fd6f7e7860cc60bee67bab815c155e86fcd.zip | |
feat(analytics): track umami events across core actions
Add a guarded track() wrapper (src/lib/analytics.ts) so programmatic
events no-op instead of throwing when umami is absent (localhost),
lazily loaded, or ad-blocked. Instrument the core loop (progress
increment, roulette, list filter, force refresh), the auth funnel
(log in/out, command palette), settings toggles/selects at the wrapper
level, sync/debug/feed actions, and tool/sharing actions.
Diffstat (limited to 'src/lib/CommandPalette/authActions.ts')
| -rw-r--r-- | src/lib/CommandPalette/authActions.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/CommandPalette/authActions.ts b/src/lib/CommandPalette/authActions.ts index 9dbc9565..3dd51bf7 100644 --- a/src/lib/CommandPalette/authActions.ts +++ b/src/lib/CommandPalette/authActions.ts @@ -1,5 +1,6 @@ import { env } from "$env/dynamic/public"; import root from "$lib/Utility/root"; +import { track } from "$lib/analytics"; import localforage from "localforage"; import locale from "$stores/locale"; import { get } from "svelte/store"; @@ -18,6 +19,8 @@ export const authActions = ( preventDefault: true, tags: ["auth", "sign", "out", "user"], onClick: async () => { + track("Log Out", { source: "command-palette" }); + await localforage.removeItem("identity"); await localforage.removeItem("commit"); @@ -38,6 +41,8 @@ export const authActions = ( preventDefault: true, tags: ["auth", "sign", "in", "anilist"], onClick: async () => { + track("Log In", { source: "command-palette" }); + await localforage.setItem( "redirect", window.location.origin + |