baidu-analytics
Integrate Baidu Analytics into VuePress.
Tips
Do not enable SPA mode in Baidu Analytics. The plugin will report page view events correctly.
Usage
npm i -D @vuepress/plugin-baidu-analytics@next
import { baiduAnalyticsPlugin } from '@vuepress/plugin-baidu-analytics'
export default {
plugins: [
baiduAnalyticsPlugin({
// options
}),
],
}
Reporting Events
The plugin will automatically report page view events when visiting and switching pages.
Besides, a global hmt
array is available on the window
object, and you can use it for custom events reporting.
Options
id
Type:
string
Details: The ID of Baidu Analytics, which is the query of
hm.js
URL.