Repository navigation
feat: Add anonymous analytics via GoatCounter - #214
Merged
Merged
Conversation
One async script tag plus a thin wrapper (js/analytics.js) that queues events until count.js arrives and silently no-ops when it's blocked or down — the playground never depends on it. Counts pageviews and a small set of per-visit events: tutorial started/completed per scenario, tasks resolved, side quests tried, TUI opened, install modal/copy, scenario switches, and outbound repo clicks. A footer note discloses the stats and links to the public dashboard; docs/README.md documents the setup. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K4HgTJBEvAQBjstvdUcrYQ
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.
Description
This PR adds optional, privacy-respecting analytics to the playground using GoatCounter. The implementation tracks key user interactions (tutorial started/completed, tasks resolved, TUI opened, install command copied, scenario switches, and outbound clicks) while maintaining the principle that the playground never depends on analytics.
The
analytics.jsmodule is a thin wrapper that silently no-ops when the GoatCounter script is blocked by adblockers, offline, or unavailable. Events are deduplicated per page load and queued until the counter script loads, with automatic retry logic. The dashboard is public at https://witr.goatcounter.com.A footer note discloses the analytics to visitors, emphasizing that nothing is stored in their browser.
Type of change
Changes
track()calls at 8 key user interaction pointsChecklist
Test Plan
The analytics module is defensive by design—all calls are silent no-ops if GoatCounter is unavailable. Manual verification:
https://claude.ai/code/session_01K4HgTJBEvAQBjstvdUcrYQ