Skip to content

Commit 6665304

Browse files
authoredMar 22, 2025
fix: google analytics (#3)
1 parent dba053a commit 6665304

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
 

‎src/components/layouts/HeadMeta.astro

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ interface Props {
88
const { title, description, image } = Astro.props;
99
---
1010

11+
<!-- Google Analytics -->
12+
<script is:inline type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-1CHQV4JH2Z"></script>
13+
<script is:inline type="text/partytown">
14+
window.dataLayer = window.dataLayer || [];
15+
function gtag(...args){dataLayer.push(args);}
16+
gtag('js', new Date());
17+
18+
gtag('config', 'G-1CHQV4JH2Z');
19+
</script>
20+
1121
<!-- Global Metadata -->
1222
<meta charset="utf-8" />
1323
<meta
@@ -37,16 +47,6 @@ const { title, description, image } = Astro.props;
3747
<meta property="twitter:description" content={description} />
3848
<meta property="twitter:image" content={new URL(image, Astro.url)} />
3949

40-
<!-- Google Analytics -->
41-
<script is:inline type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-1CHQV4JH2Z"></script>
42-
<script is:inline type="text/partytown">
43-
window.dataLayer = window.dataLayer || [];
44-
function gtag(...args){dataLayer.push(args);}
45-
gtag('js', new Date());
46-
47-
gtag('config', 'G-1CHQV4JH2Z');
48-
</script>
49-
5050
<link
5151
rel="alternate"
5252
type="application/rss+xml"

0 commit comments

Comments
 (0)