Skip to content

fix: skip Matomo tracking on localhost#538

Open
marc0olo wants to merge 1 commit intomainfrom
infra/matomo-localhost-guard
Open

fix: skip Matomo tracking on localhost#538
marc0olo wants to merge 1 commit 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
g.src = "https://cdn.matomo.cloud/internetcomputer.matomo.cloud/matomo.js";
s.parentNode.insertBefore(g, s);
})();
if (location.hostname !== "localhost" && location.hostname !== "127.0.0.1") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

maybe this should .endswith in case you are run as a canister locally too.

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