Skip to content

Commit 831d194

Browse files
committed
Add google analytics
1 parent 54c2105 commit 831d194

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/layouts/Layout.astro

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ const {
4242

4343
window.localStorage.setItem('theme', theme);
4444
</script>
45+
<!-- Google tag (gtag.js) -->
46+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-19HMY2DH6K"></script>
47+
<script>
48+
window.dataLayer = window.dataLayer || [];
49+
function gtag(){dataLayer.push(arguments);}
50+
gtag('js', new Date());
51+
52+
gtag('config', 'G-19HMY2DH6K');
53+
</script>
4554
</head>
4655
<body class="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 transition-colors">
4756
<header class="bg-gray-800 dark:bg-gray-900 text-white shadow-md sticky top-0 z-50">

0 commit comments

Comments
 (0)