Skip to content

feat(analytics): GA4 + GSC verification, README hero#33

Merged
oratis merged 1 commit into
mainfrom
claude/magical-lewin-0bfc54
Jun 27, 2026
Merged

feat(analytics): GA4 + GSC verification, README hero#33
oratis merged 1 commit into
mainfrom
claude/magical-lewin-0bfc54

Conversation

@oratis

@oratis oratis commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Step 0 of the GTM plan — "没数据 = 盲飞". Wires up analytics + Search Console so growth gets a feedback loop, plus a README facelift for the stars flywheel.

Changes

  • Analytics.tsx — GA4 via next/script (afterInteractive). Production-only so dev/preview traffic never pollutes the data. Public measurement ID (G-PPXV98MJ4Y) baked as the default with a NEXT_PUBLIC_GA_ID override — same hardcoded-default + env pattern as SITE_URL in lib/seo.
  • layout.tsx — env-gated google-site-verification meta tag (GOOGLE_SITE_VERIFICATION), inert unless set; renders <Analytics/> at the end of <body>.
  • README.md — centered hero: slogan, badges (stars / license / A2A / live), nav links, and the live OG image as the banner.

Verification

  • tsc --noEmit ✅ · eslint
  • Smoke-tested with a dev server + dummy env: gtag script, gtag config, and the google-site-verification meta all render into the SSR'd HTML.
  • OG image / badges / /badge page all return 200 on production.

Notes

  • GA ID is read server-side and written into the SSR HTML, so it works as a plain Cloud Run runtime value — no rebuild-for-inlining and no touching cloudbuild.yaml.
  • GSC can be verified via the GA4 method, so no GOOGLE_SITE_VERIFICATION token is required.

🤖 Generated with Claude Code

Step 0 of the GTM plan ("没数据=盲飞") needs an analytics feedback loop.
The GSC verification meta and README hero from #31/#32 cover the rest;
this adds the missing piece — GA4.

- Analytics.tsx: GA4 via next/script (afterInteractive). Production-only
  so dev/preview traffic never pollutes the data; public measurement ID
  baked as default with NEXT_PUBLIC_GA_ID override, matching the
  hardcoded-default + env pattern used for SITE_URL in lib/seo.
- layout: render <Analytics/> at the end of <body>.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@oratis oratis force-pushed the claude/magical-lewin-0bfc54 branch from c88b34b to 04a8721 Compare June 27, 2026 13:11
@oratis oratis merged commit fa03fcd into main Jun 27, 2026
1 check passed
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