Skip to content

Commit 4d7fef2

Browse files
authored
fix: skip Matomo tracking on all localhost subdomains (#184)
## 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
1 parent 52312f3 commit 4d7fef2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

public/matomo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (location.hostname !== "localhost" && location.hostname !== "127.0.0.1") {
1+
if (!location.hostname.endsWith("localhost") && location.hostname !== "127.0.0.1") {
22
var _paq = (window._paq = window._paq || []);
33
_paq.push(["disableCookies"]);
44
_paq.push(["enableLinkTracking"]);

0 commit comments

Comments
 (0)