Skip to content

Commit d8efa7c

Browse files
authored
Update GoogleAnalytics.astro
1 parent 35d75d7 commit d8efa7c

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed
Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
---
2-
const GA_ID = 'G-1X5E9W6VJ2';
3-
---
4-
{GA_ID && (
5-
<>
6-
<!-- Google tag (gtag.js) -->
7-
<script is:inline async src={`https://www.googletagmanager.com/gtag/js?id=${GA_ID}`}></script>
8-
<script is:inline>
9-
{`window.dataLayer = window.dataLayer || [];
10-
function gtag(){dataLayer.push(arguments);}
11-
gtag('js', new Date());
12-
gtag('config', '${GA_ID}');`}
13-
</script>
14-
</>
15-
)}
1+
<script>
2+
<!-- Google tag (gtag.js) -->
3+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1X5E9W6VJ2"></script>
4+
<script>
5+
window.dataLayer = window.dataLayer || [];
6+
function gtag(){dataLayer.push(arguments);}
7+
gtag('js', new Date());
8+
9+
gtag('config', 'G-1X5E9W6VJ2');
10+
</script>
11+
</script>

0 commit comments

Comments
 (0)