summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-07-20 09:26:32 +0200
committerYuval Adam <_@yuv.al>2025-07-20 09:26:38 +0200
commit1635d49675446f061e3f8007139fc342559cc65b (patch)
tree30e016a6f4ce0767f79b70fe453104b5dcaeb3c3 /src/components
parenta7ee68537840c6929b52be076b70d14057efd9c5 (diff)
Analytics only in prodHEADmain
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Analytics.astro5
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}