Privacy-compliant cookieless analytics#47
Open
midenotch wants to merge 1 commit into
Open
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! 🚀 |
Author
|
Done, Close: #47 |
Contributor
|
Heads up: I retargeted this from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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