Skip to content

Commit 925784f

Browse files
committed
docs: add ga
1 parent 36cf1a3 commit 925784f

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/.vitepress/config.mts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,44 @@
11
import { defineConfig } from "vitepress";
22
import { withPwa } from "@vite-pwa/vitepress";
33

4+
const getAnalyticsScripts = () => {
5+
if (process.env.NODE_ENV === "development") {
6+
return [];
7+
}
8+
9+
return [
10+
[
11+
"script",
12+
{
13+
defer: "true",
14+
"data-website-id": "3987279b-d6de-4294-bb20-b971a8ba6997",
15+
src: "https://umami.zeeland.top/script.js",
16+
},
17+
] as [string, Record<string, string>],
18+
[
19+
"script",
20+
{
21+
async: "true",
22+
src: "https://www.googletagmanager.com/gtag/js?id=G-KLE8HJYSSL",
23+
},
24+
] as [string, Record<string, string>],
25+
[
26+
"script",
27+
{},
28+
`window.dataLayer = window.dataLayer || [];
29+
function gtag(){dataLayer.push(arguments);}
30+
gtag('js', new Date());
31+
gtag('config', 'G-KLE8HJYSSL');`,
32+
] as [string, Record<string, string>, string],
33+
];
34+
};
35+
436
export default withPwa(
537
defineConfig({
638
title: "P3G",
739
description: "P3G Docs",
840
head: [
41+
...getAnalyticsScripts(),
942
["link", { rel: "icon", href: "/logo.ico" }],
1043
["meta", { property: "og:title", content: "P3G" }],
1144
[

0 commit comments

Comments
 (0)