Skip to content

Commit 95943bd

Browse files
committed
Fix Google Analytics HTML escaping
1 parent b66f0cd commit 95943bd

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

app/layout.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ export default function RootLayout({
3131
<html lang="en">
3232
<head>
3333
<script async src="https://www.googletagmanager.com/gtag/js?id=G-L0X5333Q2X"></script>
34-
<script>
35-
{`
34+
<script
35+
dangerouslySetInnerHTML={{
36+
__html: `
3637
window.dataLayer = window.dataLayer || [];
3738
function gtag(){dataLayer.push(arguments);}
3839
gtag('js', new Date());
3940
4041
gtag('config', 'G-L0X5333Q2X');
41-
`}
42-
</script>
42+
`
43+
}}
44+
/>
4345
<meta name="viewport" content="width=device-width, initial-scale=1" />
4446
<link rel="icon" href="/images/favicon.png" />
4547
</head>

0 commit comments

Comments
 (0)