Privacy-compliant cookieless analytics#47
Conversation
|
@OluRemiFour is attempting to deploy a commit to the truthixify's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@midenotch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Done, Close: #47 |
|
Heads up: I retargeted this from |
Alright, Noted. |
|
Privacy.tsx + cookieless analytics implementation look solid. A few things to clean up before merge:
git rm .kiro/specs/cookieless-analytics/.config.kiro .vscode/settings.json tsconfig.tsbuildinfo docs/CONTRIBUTING.md
git commit --amend --no-edit
git push --force-with-leaseThen I will merge. |
|
@midenotch — heads up, the cleanup I asked for last time hasn't happened yet. The PR still contains:
Plus now there are real conflicts in git fetch origin
git rebase origin/develop
git rm .kiro/specs/cookieless-analytics/.config.kiro .vscode/settings.json tsconfig.tsbuildinfo docs/CONTRIBUTING.md
echo "tsconfig.tsbuildinfo" >> .gitignore
git add .gitignore
git rebase --continue
git push --force-with-leaseThe Privacy.tsx + analytics.ts work is good and worth landing — just need to clean these out. |
Done |
|
Dev artifacts gone, rebase clean. Privacy.tsx + analytics.ts + cookieless setup + Hero/CtaStrip/Footer integration all land cleanly. Note: I'm letting the Thanks @midenotch. |
Close: #26
What was implemented
Provider: Plausible Analytics
Chosen over Umami because it's managed cloud (zero infra to maintain), EU-hosted, open-source, and under 1 KB gzipped — well within the 2 KB budget.
Files changed / created
index.html Added script.scroll.tagged-events.js — the combined Plausible extension that handles both scroll depth (automatic, no code) and custom JS events. A tiny queue shim ensures events fired before script load are not dropped. No integrity attribute is included because Plausible ships frequent minor updates and does not publish SRI hashes for their CDN build (documented in CONTRIBUTING).
analytics.ts
(new) Typed trackEvent() wrapper around window.plausible(). The rest of the codebase never touches window.plausible directly — easy to swap provider later.
Privacy.tsx
(new) Full privacy page at /privacy. Explains what Plausible collects, what it doesn't, why we chose it, and the no-cookie/no-banner guarantee. Links to Plausible's own data policy for the full legal basis.
App.tsx
Wrapped in BrowserRouter with routes for / (home) and /privacy.
Hero.tsx
"Read the Docs" → fires Read the Docs goal
"Try the Demo" → fires Try the Demo goal
Code tab clicks → fires Code Tab Change with { tab: 'send.ts' } prop
CtaStrip.tsx
"Get API Key" → fires Get API Key goal
"Read the Docs" → fires Read the Docs goal
Footer.tsx
Privacy link updated from to (internal SPA route, no full page reload).
CONTRIBUTING.md
(new) Documents the full analytics setup: why Plausible, how the script loads, every goal and where it fires, how to add new goals, the no-banner rationale, and the privacy page location.
Acceptance criteria status
Criterion Status
Provider integrated ✅ Plausible script in index.html
Goals firing ✅ 4 goals wired; scroll depth automatic
Privacy page linked from footer ✅ /privacy route, in Footer
PR explains privacy-acceptability ✅
CONTRIBUTING.md
documents the full rationale
Tracker bundle ≤ 2 KB gzipped ✅ Plausible script is ~1 KB gzipped
No cookies = no banner needed ✅ Verified; documented on Privacy page