Skip to content

feat(analytics): default GA to TXLookup property (G-19ZRJ9T0CX)#199

Open
jravinder wants to merge 1 commit into
mainfrom
chore/ga-tracking
Open

feat(analytics): default GA to TXLookup property (G-19ZRJ9T0CX)#199
jravinder wants to merge 1 commit into
mainfrom
chore/ga-tracking

Conversation

@jravinder

Copy link
Copy Markdown
Collaborator

Why

The Analytics component in app/components/Analytics.tsx is already wired into app/layout.tsx, but it only renders the gtag snippet when NEXT_PUBLIC_GA_ID is set in env. That env var was never set on Vercel, so production has been collecting zero analytics.

Change

  • New DEFAULT_GA_ID = "G-19ZRJ9T0CX" constant — the TXLookup GA4 property created today (property 539004666 under hackathon-acf11 / accounts/3000023).
  • Component now uses the env var if defined (override / per-environment), the default if not, and disables entirely if the env var is explicitly empty (NEXT_PUBLIC_GA_ID="" for local dev).

What happens on merge

  • Vercel rebuilds on tag (deploy is tag-gated per current workflow), or trigger manually via workflow_dispatch.
  • After the next deploy, page views start landing in the TXLookup property. Realtime view should show data within ~30 seconds of the first visit.

Verifying

After deploy:

ACCESS_TOKEN=$(gcloud auth application-default print-access-token)
curl -s -H "Authorization: Bearer $ACCESS_TOKEN" -H "x-goog-user-project: hackathon-acf11" \
  "https://analyticsdata.googleapis.com/v1beta/properties/539004666:runRealtimeReport" \
  -X POST -H "Content-Type: application/json" \
  -d '{"metrics":[{"name":"activeUsers"}]}'

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).
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant