Skip to content

Commit 170c1d3

Browse files
authored
fix: google analytics (#4)
1 parent 6665304 commit 170c1d3

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/components/layouts/HeadMeta.astro

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ 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-
2111
<!-- Global Metadata -->
2212
<meta charset="utf-8" />
2313
<meta
@@ -47,6 +37,17 @@ const { title, description, image } = Astro.props;
4737
<meta property="twitter:description" content={description} />
4838
<meta property="twitter:image" content={new URL(image, Astro.url)} />
4939

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+
// eslint-disable-next-line prefer-rest-params
45+
function gtag(){dataLayer.push(arguments);}
46+
gtag('js', new Date());
47+
48+
gtag('config', 'G-1CHQV4JH2Z');
49+
</script>
50+
5051
<link
5152
rel="alternate"
5253
type="application/rss+xml"

0 commit comments

Comments
 (0)