Skip to content

Commit e7e54fc

Browse files
committed
Add analytics :)
1 parent e97f4a2 commit e7e54fc

File tree

4 files changed

+42
-4
lines changed

4 files changed

+42
-4
lines changed

astro.config.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// @ts-check
22
import { defineConfig } from 'astro/config';
33

4+
import partytown from '@astrojs/partytown';
5+
46
// https://astro.build/config
57
export default defineConfig({
6-
site: 'https://ctrl-vi.github.io',
7-
});
8+
site: 'https://ctrl-vi.github.io',
9+
integrations: [partytown()],
10+
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"name": "ctrl-vi.github.io",
33
"type": "module",
44
"version": "0.0.1",
5-
"packageManager": "pnpm@10.12.1+sha512.f0dda8580f0ee9481c5c79a1d927b9164f2c478e90992ad268bbb2465a736984391d6333d2c327913578b2804af33474ca554ba29c04a8b13060a717675ae3ac",
5+
"packageManager": "pnpm@10.12.2+sha512.a32540185b964ee30bb4e979e405adc6af59226b438ee4cc19f9e8773667a66d302f5bfee60a39d3cac69e35e4b96e708a71dd002b7e9359c4112a1722ac323f",
66
"scripts": {
77
"dev": "astro dev",
88
"build": "astro build",
99
"preview": "astro check && astro preview",
1010
"astro": "astro"
1111
},
1212
"dependencies": {
13+
"@astrojs/partytown": "^2.1.4",
1314
"astro": "^5.10.0",
1415
"astro-seo": "^0.8.4",
1516
"sharp": "^0.34.2"

pnpm-lock.yaml

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Layout.astro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { SEO } from "astro-seo";
33
import type { Meta } from "astro-seo";
44
5-
import { getImagePath } from "astro-opengraph-images";
65
import Header from "./Header.astro";
76
import Footer from "./Footer.astro";
87
import Navigation from "./Navigation.astro";
@@ -71,6 +70,15 @@ const profile = ogType === "profile" ? [
7170
}}
7271
/>
7372
</head>
73+
<!-- Google tag (gtag.js) -->
74+
<script type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-R1TYZ678W1"></script>
75+
<script type="text/partytown">
76+
window.dataLayer = window.dataLayer || [];
77+
function gtag(){dataLayer.push(arguments);}
78+
gtag('js', new Date());
79+
80+
gtag('config', 'G-R1TYZ678W1');
81+
</script>
7482
<body>
7583
<Header />
7684
<Navigation />

0 commit comments

Comments
 (0)