Skip to content

Commit fae06b3

Browse files
author
iexitdev
committed
Add Google Analytics tag to site
1 parent 322a72f commit fae06b3

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

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

apps/site/src/components/Head.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
import GoogleAnalytics from "./GoogleAnalytics.astro";
23
import ThemeInit from "./ThemeInit.astro";
34
45
const { head } = Astro.locals.starlightRoute;
@@ -13,6 +14,7 @@ const reactRefreshPreamble = `
1314
---
1415

1516
<ThemeInit />
17+
<GoogleAnalytics />
1618
<style is:inline>
1719
html {
1820
background: #0b0c11;

apps/site/src/pages/index.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ChartKitFeatures from "../components/ChartKitFeatures.astro";
44
import ChartKitStats from "../components/ChartKitStats.astro";
55
import ChartsSupported from "../components/ChartsSupported";
66
import Footer from "../components/Footer.astro";
7+
import GoogleAnalytics from "../components/GoogleAnalytics.astro";
78
import Header from "../components/Header.astro";
89
import Hero from "../components/Hero.astro";
910
import Pricing from "../components/Pricing.astro";
@@ -17,6 +18,7 @@ import ThemeInit from "../components/ThemeInit.astro";
1718
<meta name="theme-color" content="#06070a" />
1819
<title>React Native Chart Kit</title>
1920
<ThemeInit />
21+
<GoogleAnalytics />
2022
</head>
2123
<body>
2224
<Header />

0 commit comments

Comments
 (0)