From 0fac56ce50714dc315015694fc2981c2f093fb16 Mon Sep 17 00:00:00 2001 From: Relakkes Date: Fri, 20 Sep 2024 19:18:48 +0800 Subject: [PATCH] docs: add google analytics --- docs/.vitepress/config.mjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index 8b46e14..0c8ea73 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -6,6 +6,20 @@ export default defineConfig({ description: "小红书爬虫,抖音爬虫, 快手爬虫, B站爬虫, 微博爬虫,百度贴吧爬虫,知乎爬虫...。 ", lastUpdated: true, base: '/MediaCrawler/', + head: [ + [ + 'script', + {async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-5TK7GF3KK1'} + ], + [ + 'script', + {}, + `window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-5TK7GF3KK1');` + ] + ], themeConfig: { editLink: { pattern: 'https://github.com/NanmiCoder/MediaCrawler/tree/main/docs/:path'