Skip to content

Commit afb72a3

Browse files
un33kclaude
andcommitted
feat: add Google Analytics tracking per Google requirements
- Added Google Analytics gtag.js immediately after opening <head> tag - Following Google's official implementation guidelines - Tracking ID: G-GC4F593HEQ - Properly integrated using Next.js dangerouslySetInnerHTML 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b3dc288 commit afb72a3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/pages/_document.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ export default function Document() {
44
return (
55
<Html lang="en" className="dark" style={{ colorScheme: "dark" }}>
66
<Head>
7+
{/* Google tag (gtag.js) - Must be first in head per Google requirements */}
8+
<script
9+
async
10+
src="https://www.googletagmanager.com/gtag/js?id=G-GC4F593HEQ"
11+
/>
12+
<script
13+
dangerouslySetInnerHTML={{
14+
__html: `
15+
window.dataLayer = window.dataLayer || [];
16+
function gtag(){dataLayer.push(arguments);}
17+
gtag('js', new Date());
18+
gtag('config', 'G-GC4F593HEQ');
19+
`,
20+
}}
21+
/>
22+
723
{/* Favicons */}
824
<link rel="icon" type="image/x-icon" href="/icons/favicon.ico" />
925
<link

0 commit comments

Comments
 (0)