Skip to content

Commit 00d632b

Browse files
committed
feat: add google tag
1 parent 06b0321 commit 00d632b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/components/BaseHead.astro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ const canonicalURL = new URL(Astro.url.pathname, Astro.site);
1313
1414
const { title } = Astro.props;
1515
---
16+
<!-- Google tag (gtag.js) -->
17+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z5M845W8X0"></script>
18+
<script>
19+
window.dataLayer = window.dataLayer || [];
20+
function gtag(){dataLayer.push(arguments);}
21+
gtag('js', new Date());
22+
23+
gtag('config', 'G-Z5M845W8X0');
24+
</script>
25+
1626
<!-- Google Tag Manager -->
1727
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
1828
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],

0 commit comments

Comments
 (0)