add Google Analytics 4 (gtag.js) tracking

Measurement ID G-2WWKKGDL6H wired via site.analytics.measurementId.
Layout conditionally injects the gtag.js loader + dataLayer init +
config call when analytics.measurementId is set, mirroring the
AdSense conditional pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Code
2026-05-01 18:35:49 +08:00
parent 5c251c3fe6
commit 16be86fdc4
2 changed files with 16 additions and 0 deletions

View File

@@ -7,4 +7,7 @@ export const site = {
enabled: true,
publisherId: '9763775565109295',
},
analytics: {
measurementId: 'G-2WWKKGDL6H',
},
};