Back to Docusaurus

📦 plugin-vercel-analytics

website/versioned_docs/version-3.6.3/api/plugins/plugin-vercel-analytics.mdx

3.10.11.3 KB
Original Source

📦 plugin-vercel-analytics

import APITable from '@site/src/components/APITable';

Vercel Analytics provides comprehensive insights into your website's visitors, tracking top pages, referrers, and demographics like location, operating systems, and browser info.

:::warning production only

This plugin is always inactive in development and only active in production (docusaurus build) to avoid polluting the analytics statistics.

:::

Installation

bash
npm install --save @docusaurus/plugin-vercel-analytics

Configuration

Accepted fields:

mdx-code-block
<APITable>
NameTypeDefaultDescription
modestring'auto'Override the automatic environment detection. Read the official docs for details.
debugbooleanundefinedEnable browser console logging of analytics events. Read the official docs for details.
mdx-code-block
</APITable>

Example configuration

You can configure this plugin through plugin options.

js
export default {
  plugins: [
    [
      'vercel-analytics',
      {
        debug: true,
        mode: 'auto',
      },
    ],
  ],
};