feat(analytics): add Web Vitals tracking, GlitchTip user context, and funnel events

- Add web-vitals package with LCP/CLS/INP/FCP/TTFB → Umami tracking
- Set GlitchTip user context on login, clear on logout
- Add funnel events: first_content_created, user_return_visit,
  second_module_used, guest_converted
- Track first content via Dexie creating hook (fires once per user)
- Track module usage via route navigation effect
- Track guest→registered conversion on signup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-02 17:03:06 +02:00
parent 198720ca38
commit f2d6573fa7
9 changed files with 188 additions and 3 deletions

View file

@ -9,7 +9,8 @@
".": "./src/index.ts",
"./analytics": "./src/analytics.ts",
"./analytics-server": "./src/analytics-server.ts",
"./security-headers": "./src/security-headers.ts"
"./security-headers": "./src/security-headers.ts",
"./web-vitals": "./src/web-vitals.ts"
},
"scripts": {
"type-check": "tsc --noEmit",
@ -17,7 +18,8 @@
"lint": "eslint ."
},
"dependencies": {
"date-fns": "^4.1.0"
"date-fns": "^4.1.0",
"web-vitals": "^5.2.0"
},
"devDependencies": {
"@types/node": "^24.10.1",