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/List/Manga | |
| 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/List/Manga')
| -rw-r--r-- | src/lib/List/Manga/CleanMangaList.svelte | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/List/Manga/CleanMangaList.svelte b/src/lib/List/Manga/CleanMangaList.svelte index 25e6d48f..af52ca02 100644 --- a/src/lib/List/Manga/CleanMangaList.svelte +++ b/src/lib/List/Manga/CleanMangaList.svelte @@ -31,6 +31,7 @@ import CleanList from "../CleanList.svelte"; import stateBin from "$stores/stateBin"; import localforage from "localforage"; import MediaRoulette from "../MediaRoulette.svelte"; +import { track } from "$lib/analytics"; export let media: Media[]; export let cleanCache: () => void; @@ -105,6 +106,10 @@ $: filteredMedia = const updateSelectedList = (event: Event) => { const nextSelectedList = (event.currentTarget as HTMLSelectElement).value; + track("Filter Manga List", { + scope: nextSelectedList === "All" ? "all" : "custom", + }); + selectedList = nextSelectedList; if (!disableFilter && $stateBin[filterKey] !== nextSelectedList) @@ -125,8 +130,11 @@ $: if (rateLimited && !serviceStatusResponse) serviceStatusResponse = getMangadexServiceStatus(); const increment = (manga: Media) => { - if (!(pendingUpdate === manga.id || dummy)) + if (!(pendingUpdate === manga.id || dummy)) { + track("Increment Manga Progress"); + updateMedia(manga.id, manga.mediaListEntry?.progress, media); + } }; </script> @@ -154,6 +162,7 @@ const increment = (manga: Media) => { class="small-button" onclick={() => (showRoulette = true)} title={$locale().lists.actions?.pickRandomManga} + data-umami-event="Open Manga Roulette" > Roulette </button> |