Skip to content

Commit 4f85ccb

Browse files
committed
feat(vuepress): add google analytics
1 parent 2bd8483 commit 4f85ccb

File tree

3 files changed

+788
-20
lines changed

3 files changed

+788
-20
lines changed

.vitepress/config.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import fs from 'fs'
22
import path from 'path'
33
import { defineConfigWithTheme } from 'vitepress'
4+
import {googleAnalyticsPlugin} from '@vuepress/plugin-google-analytics'
45
import type { Config as ThemeConfig } from '@vue/theme'
56
import baseConfig from '@vue/theme/config'
67
import { headerPlugin } from './headerMdPlugin'
@@ -199,10 +200,10 @@ export default defineConfigWithTheme<ThemeConfig>({
199200
}
200201
},
201202

202-
carbonAds: {
203-
code: 'CEBDT27Y',
204-
placement: 'vuejsorg'
205-
},
203+
// carbonAds: {
204+
// code: 'CEBDT27Y',
205+
// placement: 'vuejsorg'
206+
// },
206207

207208
socialLinks: [
208209
// { icon: 'languages', link: '/translations/' },
@@ -259,5 +260,11 @@ export default defineConfigWithTheme<ThemeConfig>({
259260

260261
vue: {
261262
reactivityTransform: true
262-
}
263+
},
264+
265+
plugins: [
266+
googleAnalyticsPlugin({
267+
id: 'G-GPRCVYSQSG',
268+
}),
269+
],
263270
})

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
},
2020
"devDependencies": {
2121
"@types/markdown-it": "^12.2.3",
22-
"@types/node": "^16.9.1"
22+
"@types/node": "^16.9.1",
23+
"@vuepress/plugin-google-analytics": "2.0.0-beta.49"
2324
},
2425
"pnpm": {
2526
"peerDependencyRules": {

0 commit comments

Comments
 (0)