📦 plugin-vercel-analytics
Vercel Analytics provides comprehensive insights into your website's visitors, tracking top pages, referrers, and demographics like location, operating systems, and browser info.
production only
This plugin is always inactive in development and only active in production (docusaurus build
) to avoid polluting the analytics statistics.
Installation
- npm
- Yarn
- pnpm
npm install --save @docusaurus/plugin-vercel-analytics
yarn add @docusaurus/plugin-vercel-analytics
pnpm add @docusaurus/plugin-vercel-analytics
Configuration
接受的字段:
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
mode | string | 'auto' | Override the automatic environment detection. Read the official docs for details. |
debug | boolean | undefined | Enable browser console logging of analytics events. Read the official docs for details. |
Example configuration
你可以通过插件选项来配置这个插件。
docusaurus.config.js
export default {
plugins: [
[
'vercel-analytics',
{
debug: true,
mode: 'auto',
},
],
],
};