Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sigoden/gatsby-plugin-baidu-tongji
添加百度统计到 Gatsby 站点
https://github.com/sigoden/gatsby-plugin-baidu-tongji
baidu gatsby gatsby-plugin
Last synced: about 1 month ago
JSON representation
添加百度统计到 Gatsby 站点
- Host: GitHub
- URL: https://github.com/sigoden/gatsby-plugin-baidu-tongji
- Owner: sigoden
- License: mit
- Created: 2018-03-16T08:37:42.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-03T13:58:46.000Z (almost 6 years ago)
- Last Synced: 2024-11-12T07:40:31.007Z (3 months ago)
- Topics: baidu, gatsby, gatsby-plugin
- Language: JavaScript
- Size: 202 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gatsby-plugin-baidu-tongji
添加百度统计到 Gatsby 站点。
## 安装
`npm install --save gatsby-plugin-baidu-tongji`
## 使用方法
```javascript
// ./gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-baidu-tongji`,
options: {
// 百度统计站点ID
siteid: "YOUR_BAIDU_TONGJI_SITE_ID",
// 配置统计脚本插入位置,默认值为 false, 表示插入到 body 中, 为 true 时插入脚本到 head 中
head: false,
},
},
];
```## 获取 siteid
浏览器进入 https://tongji.baidu.com/, 依次点击: 管理(导航栏)-> 代码获取(侧边栏),进入如下页面
![百度统计界面](tongji-screenshot.png)
上图代码中 hm.baidu.com/h.js%3F 后面的32个16进制数,就是该站点的站点id