Skip to content

add StatCounter tracking to openstan.org - #210

Merged
boscorat merged 2 commits into
masterfrom
add-statcounter
Sep 12, 2026
Merged

boscorat merged 2 commits into
masterfrom
add-statcounter

Conversation

@boscorat

Copy link
Copy Markdown
Owner

Adds StatCounter analytics tracking alongside existing GoatCounter. The StatCounter script (project 13354789) is injected in the analytics block 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.js in the analytics template 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.

Comment thread docs/overrides/main.html
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.
@boscorat
boscorat merged commit 6a1becb into master Sep 12, 2026
2 checks passed
@boscorat
boscorat deleted the add-statcounter branch September 12, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants