Skip to content

Commit fddcf17

Browse files
committed
feat: use static GA ID in GoogleAnalytics component
1 parent e7138c5 commit fddcf17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/GoogleAnalytics.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
const GA_ID = import.meta.env.PUBLIC_GA_ID ?? 'G-1X5E9W6VJ2';
2+
const GA_ID = 'G-1X5E9W6VJ2';
33
---
44
{GA_ID && (
5-
<>
5+
<>
66
<!-- Google tag (gtag.js) -->
7-
<script async src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`}></script>
8-
<script>
7+
<script is:inline async src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`}></script>
8+
<script is:inline>
99
{`window.dataLayer = window.dataLayer || [];
1010
function gtag(){dataLayer.push(arguments);}
1111
gtag('js', new Date());

0 commit comments

Comments
 (0)