feat(telemetry): opt-in anonymous learning-funnel events - #94
Open
OthmaneZ05 wants to merge 1 commit into
Open
Conversation
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.
Summary of Changes
Adds strictly opt-in, anonymous product telemetry for the learning funnel. Five custom events (
roadmap_started,step_validated,step_failed,roadmap_completed,roadmap_abandoned) are sent as Plausible-format custom events to a build-time-configurable endpoint (VITE_TELEMETRY_ENDPOINT/VITE_TELEMETRY_DOMAIN; an empty endpoint hard-disables telemetry entirely).unset/accepted/declined, localStorage keytorollo_telemetry_consent): anything other than an explicit accept means zero network requests. A one-time, non-blocking consent card on the home screen asks the question; a header toggle makes the choice reversible at any time.step_failedonly counts pedagogical failures — validator runs that end in an engineerror(e.g. Docker unreachable) are not counted;roadmap_startedonly fires when the backend progress store is confirmed empty;roadmap_completedfires once, on the validation that completes the roadmap;roadmap_abandonedfires once per play-through on close/unmount/pagehide (withkeepaliveso it survives tab close).Types of Changes
Verification & Testing
Automated Checks
npm run lintsuccessfully with no errorsnpm run buildsuccessfully with no compilation errorsnpm testsuccessfully (all tests pass)322 frontend tests pass, including new suites: consent store (tri-state, install-id lifecycle, storage-disabled fallback),
trackEvent(zero fetch calls when declined/unset, exact payload prop allowlist, keepalive passthrough, never throws on network failure), and the player hook wiring for all five events (including the no-restart-on-resume and no-abandon-after-completion negatives).Manual Verification
Full E2E run against the real backend + real Docker with a local Plausible-shaped capture server and Playwright driving the UI (20/20 checks):
roadmap_started), a real validator pass (step_validated), a real fail on a missing container (step_failed), closing mid-roadmap (roadmap_abandonedwith the correct step id), and creating the missing container then validating (step_validated+roadmap_completed).roadmap_started; closing a completed roadmap fires noroadmap_abandoned.roadmap/step/install_id/app_version, one stable random install id, configured domain honoured, no PII strings.Checklist
🤖 Generated with Claude Code