Skip to content

chore: switch analytics from gtm to plausible#609

Merged
jdx merged 2 commits intomainfrom
claude/plausible-analytics
Apr 27, 2026
Merged

chore: switch analytics from gtm to plausible#609
jdx merged 2 commits intomainfrom
claude/plausible-analytics

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 27, 2026

Summary

  • Drops Google Tag Manager from the docs site
  • Adds Plausible Analytics via the shrill.en.dev Cloudflare worker proxy

🤖 Generated with Claude Code


Note

Low Risk
Low risk: only updates a client-side analytics script in VitePress head metadata with no impact on core app logic or data handling beyond pageview tracking.

Overview
Switches the docs site analytics integration in docs/.vitepress/config.mts by removing the inline Google Tag Manager/gtag setup and loading a deferred Plausible-style script instead.

The new script is configured via data-domain and a custom data-api endpoint pointing at the shrill.en.dev proxy.

Reviewed by Cursor Bugbot for commit 83af975. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces Google Tag Manager with a new analytics script in the VitePress configuration. Feedback was provided to ensure the data-domain attribute uses the actual site domain rather than a placeholder to guarantee correct event attribution.

Comment thread docs/.vitepress/config.mts Outdated
gtag('config', 'G-63L7VEB1RB');`
{
defer: "",
"data-domain": "pa-9z3f-p-ATqjtilwc0InyS",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The data-domain attribute for Plausible Analytics typically requires the actual domain name of the site (e.g., usage.jdx.dev) to correctly attribute events in the dashboard. The value pa-9z3f-p-ATqjtilwc0InyS appears to be a placeholder or an incorrect identifier. Unless your custom proxy specifically maps this ID to the domain, you should use the site's domain name here.

        "data-domain": "usage.jdx.dev",

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR replaces Google Tag Manager with Plausible Analytics on the docs site, loading the tracking script through a Cloudflare worker proxy at shrill.en.dev to improve privacy and avoid ad blockers. The change is confined to a single config file and carries no functional risk to the docs content itself.

Confidence Score: 5/5

Safe to merge — single-file docs config change with no impact on library functionality.

No P0 or P1 issues found. The change correctly swaps two GTM script tags for one deferred Plausible script; all attributes (defer, data-domain, data-api, src) look well-formed and intentional.

No files require special attention.

Important Files Changed

Filename Overview
docs/.vitepress/config.mts Removes two GTM script tags and replaces them with a single deferred Plausible script routed through the shrill.en.dev proxy; no logic issues found.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant shrill.en.dev (CF Worker)
    participant Plausible Analytics

    Browser->>shrill.en.dev (CF Worker): GET /shrill/script.js
    shrill.en.dev (CF Worker)-->>Browser: Plausible tracking script

    Browser->>shrill.en.dev (CF Worker): POST /f5f1/event (pageview)
    shrill.en.dev (CF Worker)->>Plausible Analytics: Forward event for usage.jdx.dev
    Plausible Analytics-->>shrill.en.dev (CF Worker): 202 Accepted
    shrill.en.dev (CF Worker)-->>Browser: 202 Accepted
Loading

Reviews (2): Last reviewed commit: "fix: use site domain for plausible data-..." | Re-trigger Greptile

Comment thread docs/.vitepress/config.mts Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.03%. Comparing base (577390b) to head (83af975).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #609   +/-   ##
=======================================
  Coverage   79.03%   79.03%           
=======================================
  Files          48       48           
  Lines        7235     7235           
  Branches     7235     7235           
=======================================
  Hits         5718     5718           
  Misses       1140     1140           
  Partials      377      377           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx merged commit 86b24de into main Apr 27, 2026
10 checks passed
@jdx jdx deleted the claude/plausible-analytics branch April 27, 2026 16:12
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.

1 participant