Skip to content

fix: skip Matomo tracking on localhost#538

Merged
raymondk merged 2 commits into
mainfrom
infra/matomo-localhost-guard
May 5, 2026
Merged

fix: skip Matomo tracking on localhost#538
raymondk merged 2 commits into
mainfrom
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
@raymondk raymondk merged commit d551b69 into main May 5, 2026
33 checks passed
@raymondk raymondk deleted the infra/matomo-localhost-guard branch May 5, 2026 15:57
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