From be151fd6f7e7860cc60bee67bab815c155e86fcd Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Fri, 29 May 2026 23:05:37 +0000
Subject: 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.
---
 src/lib/Tools/Tracker/Tool.svelte | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

(limited to 'src/lib/Tools/Tracker/Tool.svelte')

diff --git a/src/lib/Tools/Tracker/Tool.svelte b/src/lib/Tools/Tracker/Tool.svelte
index b495522a..3185e79b 100644
--- a/src/lib/Tools/Tracker/Tool.svelte
+++ b/src/lib/Tools/Tracker/Tool.svelte
@@ -88,8 +88,10 @@ const deleteEntry = async (id: string) => {
     placeholder={$locale().tools.tracker?.progressPlaceholder}
     bind:value={progress}
   />
-  <button class="button-lined" onclick={() => addEntry(url, title, progress)}
-    >{$locale().common?.add}</button
+  <button
+    class="button-lined"
+    onclick={() => addEntry(url, title, progress)}
+    data-umami-event="Add Tracker Entry">{$locale().common?.add}</button
   >
 
   <Spacer />
@@ -125,16 +127,20 @@ const deleteEntry = async (id: string) => {
               <button
                 class="button-square button-action"
                 onclick={() => adjustEntry(entry.id, entry.progress - 1)}
+                data-umami-event="Decrement Tracker Progress"
                 >-
               </button>
               <button
                 class="button-square button-action"
                 onclick={() => adjustEntry(entry.id, entry.progress + 1)}
+                data-umami-event="Increment Tracker Progress"
               >
                 +
               </button>
               <span class="opaque">|</span>
-              <button onclick={() => deleteEntry(entry.id)}>{$locale().common?.remove}</button>
+              <button onclick={() => deleteEntry(entry.id)} data-umami-event="Delete Tracker Entry"
+                >{$locale().common?.remove}</button
+              >
             </span>
           </div>
         </li>
-- 
cgit v1.2.3

