Skip to content

Commit

Permalink
fix Google Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyi-Lin committed Jun 3, 2024
1 parent f3274d5 commit 8636e85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig, type DefaultTheme} from 'vitepress'
var base_path_guide_cloud = '/zh/guide_cloud'
var base_path_examples = '/zh/examples'
var base_path_api = '/zh/api'

// 谷歌分析ID
const GTAG = 'G-3DJ621D31F'

Expand All @@ -18,12 +19,15 @@ export default defineConfig({
['link', { rel: 'icon', type:"image/png", href: '/icon.png' }],
[
'script',
{ async: '', src: `https://www.googletagmanager.com/gtag/js?id=${GTAG}` }
{ async: '', src: `https://www.googletagmanager.com/gtag/js?id=${GTAG}`}
],
[
'script',
{},
`window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', ${GTAG});`
`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${GTAG}');`
]
],

Expand Down

0 comments on commit 8636e85

Please sign in to comment.