From 6bdac201f28f731b4d696271170c967b3831b15a Mon Sep 17 00:00:00 2001 From: Paul Wackerow <54227730+wackerow@users.noreply.github.com> Date: Mon, 21 Jul 2025 17:42:15 -0700 Subject: [PATCH] feat: respect doNotTrack preference for Matomo --- src/lib/utils/matomo.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/utils/matomo.ts b/src/lib/utils/matomo.ts index 087f948ad3b..f64952b1a2a 100644 --- a/src/lib/utils/matomo.ts +++ b/src/lib/utils/matomo.ts @@ -18,6 +18,10 @@ export const trackCustomEvent = ({ eventValue, }: MatomoEventOptions): void => { if (!IS_PROD) return + + // Respect Do Not Track header + if (navigator.doNotTrack === "1") return + const optedOutValue = localStorage.getItem(MATOMO_LS_KEY) || "false" const isOptedOut = JSON.parse(optedOutValue) if (isOptedOut) return