Skip to content

fix: skip Matomo tracking on localhost#538

Open
marc0olo wants to merge 2 commits intomainfrom
infra/matomo-localhost-guard
Open

fix: skip Matomo tracking on localhost#538
marc0olo wants to merge 2 commits intomainfrom
infra/matomo-localhost-guard

Conversation

@marc0olo
Copy link
Copy Markdown
Member

Summary

  • Wraps the Matomo script in a location.hostname guard so tracking is skipped on localhost and 127.0.0.1
  • Because matomo.js is deployed once at the site root and referenced by all versioned builds, this fix covers all versions globally

@marc0olo marc0olo requested a review from a team as a code owner April 30, 2026 06:46
Comment thread docs-site/matomo.js Outdated
@marc0olo marc0olo force-pushed the infra/matomo-localhost-guard branch from e493901 to eb5249a Compare May 4, 2026 08:17
marc0olo added a commit to dfinity/developer-docs that referenced this pull request May 4, 2026
## Summary

- Use `endsWith("localhost")` instead of `!== "localhost"` in the Matomo
guard so tracking is also skipped on `*.localhost` subdomains (e.g.
`myapp.localhost`), which browsers treat as local
- Aligns with the same fix applied in dfinity/icp-cli#538

## Sync recommendation

hand-written
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