Skip to content

Add Google Analytics (gtag.js) tracking - #2

Draft
alnutile wants to merge 2 commits into
masterfrom
claude/google-analytics-tracking-95z4s3
Draft

Add Google Analytics (gtag.js) tracking#2
alnutile wants to merge 2 commits into
masterfrom
claude/google-analytics-tracking-95z4s3

Conversation

@alnutile

Copy link
Copy Markdown
Owner

What

Adds the Google Analytics gtag.js tracking snippet (measurement ID G-S7M4S4ZKQN) to the site so page views are tracked.

How

Since this is a Next.js App Router project, the tag is added to the root layout (app/layout.tsx) using next/script with strategy="afterInteractive" — the recommended way to load analytics in Next.js. This applies the tag site-wide (equivalent to putting it in index.html for a static site).

Verification

  • npm run build passes cleanly.

Once merged and deployed, the tag will be live on every page so Google can verify/test the connection.


Generated by Claude Code

claude added 2 commits July 28, 2026 22:38
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QkWj3GaYUbU3Jy51txKbsJ
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QkWj3GaYUbU3Jy51txKbsJ
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.

2 participants