Skip to content

Commit 6d4bbe3

Browse files
committed
chore: add google analytics
1 parent c243eb7 commit 6d4bbe3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

vitepress.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ export default defineConfig({
3535
linkText: '返回首页',
3636
},
3737

38+
head: [
39+
[
40+
'script',
41+
{ async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-Q89M3V8EG8' }
42+
],
43+
[
44+
'script',
45+
{},
46+
`window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-Q89M3V8EG8');`
47+
]
48+
],
49+
3850
footer: {
3951
copyright: 'Copyright © NewStar CTF',
4052
message: `<a href="https://beian.miit.gov.cn/" target="_blank" style="text-decoration: none;">浙ICP备2023000643号-8</a>`,

0 commit comments

Comments
 (0)