From dfdba1cab3f204a5a5216c555fb3eac62b04ef76 Mon Sep 17 00:00:00 2001 From: Ravinder Jilkapally Date: Tue, 26 May 2026 11:17:30 -0500 Subject: [PATCH] feat(analytics): default GA to TXLookup property (G-19ZRJ9T0CX) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Component previously rendered nothing unless NEXT_PUBLIC_GA_ID was set in env, which it never was on Vercel — so prod has had no analytics. Bake the TXLookup measurement ID (hackathon-acf11 / accounts/3000023) as the default and keep the env var as an override (set NEXT_PUBLIC_GA_ID="" to disable on local dev). --- app/components/Analytics.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/Analytics.tsx b/app/components/Analytics.tsx index f055248..882b600 100644 --- a/app/components/Analytics.tsx +++ b/app/components/Analytics.tsx @@ -1,14 +1,18 @@ /** - * Google Analytics 4 — set NEXT_PUBLIC_GA_ID in env to enable. - * If unset (e.g. local dev), the component renders nothing. + * Google Analytics 4 — defaults to the TXLookup property (G-19ZRJ9T0CX). + * Override via NEXT_PUBLIC_GA_ID env (e.g. staging → different property). + * Set NEXT_PUBLIC_GA_ID="" explicitly to disable (e.g. local dev). * * Server component (no "use client") — emits the gtag bootstrap inline so * the GA script loads early in the document. */ import Script from "next/script"; +const DEFAULT_GA_ID = "G-19ZRJ9T0CX"; // TXLookup property (hackathon-acf11 / acct 3000023) + export function Analytics() { - const id = process.env.NEXT_PUBLIC_GA_ID; + const env = process.env.NEXT_PUBLIC_GA_ID; + const id = env === undefined ? DEFAULT_GA_ID : env; if (!id) return null; return ( <>