diff options
| author | Yuval Adam <_@yuv.al> | 2025-07-20 09:26:32 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2025-07-20 09:26:38 +0200 |
| commit | 1635d49675446f061e3f8007139fc342559cc65b (patch) | |
| tree | 30e016a6f4ce0767f79b70fe453104b5dcaeb3c3 /src/components | |
| parent | a7ee68537840c6929b52be076b70d14057efd9c5 (diff) | |
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Analytics.astro | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/Analytics.astro b/src/components/Analytics.astro index 0352bea..4b6cdb9 100644 --- a/src/components/Analytics.astro +++ b/src/components/Analytics.astro @@ -3,10 +3,11 @@ import { analytics } from "../config/analytics"; const GOOGLE_ANALYTICS_ID = analytics.googleAnalyticsId; const FATHOM_ANALYTICS_ID = analytics.fathomAnalyticsId; +const isProduction = import.meta.env.PROD; --- { - GOOGLE_ANALYTICS_ID && ( + isProduction && GOOGLE_ANALYTICS_ID && ( <script async src={`https://www.googletagmanager.com/gtag/js?id=${GOOGLE_ANALYTICS_ID}`} @@ -22,7 +23,7 @@ const FATHOM_ANALYTICS_ID = analytics.fathomAnalyticsId; ) } { - FATHOM_ANALYTICS_ID && ( + isProduction && FATHOM_ANALYTICS_ID && ( <script src="https://cdn.usefathom.com/script.js" data-site={FATHOM_ANALYTICS_ID} |
