Skip to content

fix: only load Plausible analytics in production#2672

Open
mroderick wants to merge 1 commit into
masterfrom
fix/plausible-404-in-dev
Open

fix: only load Plausible analytics in production#2672
mroderick wants to merge 1 commit into
masterfrom
fix/plausible-404-in-dev

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

The Plausible script at /js/script.js is proxied through nginx in production (to bypass adblockers) but doesn't exist in development, causing a ActionController::RoutingError: No route matches [GET] "/js/script.js" on every page load.

Fix: wrap the script block in a Rails.env.production? guard so it only loads in production.

The Plausible script at /js/script.js is proxied through nginx
in production (bypasses adblockers), but doesn't exist in
development, causing a 404 on every page load.
@mroderick mroderick marked this pull request as ready for review June 25, 2026 18:41
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