Add Rybbit analytics alongside Umami

- Load Rybbit script via app.html (recommended SvelteKit approach)
- Mirror all Umami custom events (First guess, Guessed correctly, Share, Copy to Clipboard, social link clicks) with rybbit.event()
- Identify logged-in users with name/email traits; anonymous users by stable UUID

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
George Powell
2026-02-21 17:13:41 -05:00
parent 6554ef8f41
commit 3036264d44
5 changed files with 32 additions and 7 deletions

View File

@@ -47,7 +47,7 @@
() => dailyVerse.date,
() => dailyVerse.reference,
() => correctBookId,
() => user?.id,
() => user,
);
let guessedIds = $derived(
@@ -86,6 +86,7 @@
(window as any).umami
) {
(window as any).umami.track("First guess");
(window as any).rybbit?.event("First guess");
localStorage.setItem(key, "true");
}
}
@@ -209,6 +210,9 @@
(window as any).umami.track("Guessed correctly", {
totalGuesses: persistence.guesses.length,
});
(window as any).rybbit?.event("Guessed correctly", {
totalGuesses: persistence.guesses.length,
});
}
});