plugin-google-analytics
@vuepress/plugin-google-analytics 作用:集成谷歌统计,有效分析网站用户数据
# 安装
yarn add -D @vuepress/plugin-google-analytics
# OR npm install -D @vuepress/plugin-google-analytics
1
2
3
2
3
注意
如果你的项目正在使用 Google analytics 插件,推荐使用 Yarn (opens new window)而不是 npm 来安装所有依赖。因为在这种情形下,npm 会生成错误的依赖树。
# 登录谷歌统计后台
# 创建站点
# 配置
module.exports = {
plugins: ['google-analytics',
{
'ga':'UA-00000000-0'
}]
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 选项
# ga
- 类型:
string
- 默认值:
undefined
提供 Google Analytics ID 以启用集成。
上次更新: 2021/06/16, 17:25:28