Skip to content

Commit 01ec690

Browse files
committed
docs: add google analytics
1 parent 95de65e commit 01ec690

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/.vitepress/config.mjs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,24 @@ export default defineConfig({
66
title: "程序员阿江-Relakkes的爬虫教程",
77
description: "程序员阿江-Relakkes的爬虫教程",
88
lastUpdated: true,
9+
head: [
10+
[
11+
'script',
12+
{async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-B5H6D2HDGK'}
13+
],
14+
[
15+
'script',
16+
{},
17+
`window.dataLayer = window.dataLayer || [];
18+
function gtag(){dataLayer.push(arguments);}
19+
gtag('js', new Date());
20+
gtag('config', 'G-B5H6D2HDGK');`
21+
]
22+
],
923
themeConfig: {
10-
editLink: {
11-
pattern: 'https://github.com/NanmiCoder/CrawlerTutorial/tree/main/docs/:path'
12-
},
24+
editLink: {
25+
pattern: 'https://github.com/NanmiCoder/CrawlerTutorial/tree/main/docs/:path'
26+
},
1327
search: {
1428
provider: 'local'
1529
},

0 commit comments

Comments
 (0)