add StatCounter tracking to openstan.org - #210
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The StatCounter script is currently injected unconditionally, changing behavior for local/preview/fork builds and potentially polluting analytics and breaking offline docs rendering.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR adds StatCounter analytics tracking to the docs site by injecting the StatCounter snippet into the analytics block of the MkDocs theme base template override (docs/overrides/main.html), alongside the existing GoatCounter integration.
Changes:
- Inject StatCounter project variables and load
counter.jsin theanalyticstemplate block. - Keep existing GoatCounter tracking (currently gated on
config.extra.goatcounter_url) intact.
File summaries
| File | Description |
|---|---|
| docs/overrides/main.html | Adds StatCounter tracking scripts to the docs theme analytics block. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Addresses review: StatCounter was injected unconditionally, unlike GoatCounter which is gated behind an env var. Now both are conditional, so local builds, forks, and preview deploys won't hit StatCounter.
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.
Adds StatCounter analytics tracking alongside existing GoatCounter. The StatCounter script (project 13354789) is injected in the
analyticsblock of the base template override.No env vars or CI changes needed — the project ID and security code are embedded directly in the template (they're visible in page source anyway, not secrets).
Once merged, the docs workflow will deploy automatically and StatCounter will start tracking.