"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["12395"],{80296:function(e,r,n){n.r(r),n.d(r,{metadata:()=>t,contentTitle:()=>u,default:()=>h,assets:()=>d,toc:()=>p,frontMatter:()=>s});var t=JSON.parse('{"id":"api/plugins/plugin-vercel-analytics","title":"\uD83D\uDCE6 plugin-vercel-analytics","description":"Vercel Analytics provides comprehensive insights into your website\'s visitors, tracking top pages, referrers, and demographics like location, operating systems, and browser info.","source":"@site/docs/api/plugins/plugin-vercel-analytics.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-vercel-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-vercel-analytics","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-vercel-analytics.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729166052000,"sidebarPosition":11,"frontMatter":{"sidebar_position":11,"slug":"/api/plugins/@docusaurus/plugin-vercel-analytics"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-sitemap","permalink":"/docs/api/plugins/@docusaurus/plugin-sitemap"},"next":{"title":"Themes overview","permalink":"/docs/api/themes"}}'),a=n("24246"),i=n("80980"),o=n("15398"),l=n("58636"),c=n("32240");let s={sidebar_position:11,slug:"/api/plugins/@docusaurus/plugin-vercel-analytics"},u="\uD83D\uDCE6 plugin-vercel-analytics",d={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function f(e){let r={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.a)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.header,{children:(0,a.jsx)(r.h1,{id:"-plugin-vercel-analytics",children:"\uD83D\uDCE6 plugin-vercel-analytics"})}),"\n","\n",(0,a.jsxs)(r.p,{children:[(0,a.jsx)(r.a,{href:"https://vercel.com/docs/analytics",children:"Vercel Analytics"})," provides comprehensive insights into your website's visitors, tracking top pages, referrers, and demographics like location, operating systems, and browser info."]}),"\n",(0,a.jsx)(r.admonition,{title:"production only",type:"warning",children:(0,a.jsxs)(r.p,{children:["This plugin is always inactive in development and ",(0,a.jsx)(r.strong,{children:"only active in production"})," (",(0,a.jsx)(r.code,{children:"docusaurus build"}),") to avoid polluting the analytics statistics."]})}),"\n",(0,a.jsx)(r.h2,{id:"installation",children:"Installation"}),"\n",(0,a.jsxs)(o.Z,{groupId:"npm2yarn",children:[(0,a.jsx)(l.Z,{value:"npm",children:(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-vercel-analytics\n"})})}),(0,a.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-vercel-analytics\n"})})}),(0,a.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-vercel-analytics\n"})})})]}),"\n",(0,a.jsx)(r.h2,{id:"configuration",children:"Configuration"}),"\n",(0,a.jsx)(r.p,{children:"Accepted fields:"}),"\n",(0,a.jsx)(c.Z,{children:(0,a.jsxs)(r.table,{children:[(0,a.jsx)(r.thead,{children:(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.th,{children:"Name"}),(0,a.jsx)(r.th,{children:"Type"}),(0,a.jsx)(r.th,{children:"Default"}),(0,a.jsx)(r.th,{children:"Description"})]})}),(0,a.jsxs)(r.tbody,{children:[(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"mode"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"string"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"'auto'"})}),(0,a.jsxs)(r.td,{children:["Override the automatic environment detection. Read the ",(0,a.jsx)(r.a,{href:"https://vercel.com/docs/analytics/package#mode",children:"official docs"})," for details."]})]}),(0,a.jsxs)(r.tr,{children:[(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"debug"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"boolean"})}),(0,a.jsx)(r.td,{children:(0,a.jsx)(r.code,{children:"undefined"})}),(0,a.jsxs)(r.td,{children:["Enable browser console logging of analytics events. Read the ",(0,a.jsx)(r.a,{href:"https://vercel.com/docs/analytics/package#debug",children:"official docs"})," for details."]})]})]})]})}),"\n",(0,a.jsx)(r.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,a.jsx)(r.p,{children:"You can configure this plugin through plugin options."}),"\n",(0,a.jsx)(r.pre,{children:(0,a.jsx)(r.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n [\n 'vercel-analytics',\n {\n debug: true,\n mode: 'auto',\n },\n ],\n ],\n};\n"})})]})}function h(e={}){let{wrapper:r}={...(0,i.a)(),...e.components};return r?(0,a.jsx)(r,{...e,children:(0,a.jsx)(f,{...e})}):f(e)}},58636:function(e,r,n){n.d(r,{Z:()=>o});var t=n("24246");n("27378");var a=n("90496");let i="tabItem_pnkT";function o(e){var r=e.children,n=e.hidden,o=e.className;return(0,t.jsx)("div",{role:"tabpanel",className:(0,a.Z)(i,o),hidden:n,children:r})}},15398:function(e,r,n){n.d(r,{Z:()=>k});var t=n("24246"),a=n("27378"),i=n("90496"),o=n("54947"),l=n("3620"),c=n("844"),s=n("97486"),u=n("32263"),d=n("16971");function p(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n child <".concat("string"==typeof e.type?e.type:e.type.name,'>: all children of the component should be , and every should have a unique "value" prop.'))}))||void 0===r?void 0:r.filter(Boolean))&&void 0!==n?n:[]}function b(e){var r=e.value;return e.tabValues.some(function(e){return e.value===r})}var v=n("71607");let g="tabList_Qoir",y="tabItem_AQgk";function m(e){for(var r=1;r0)throw Error('Docusaurus error: Duplicate values "'.concat(r.map(function(e){return e.value}).join(", "),'" found in . Every value needs to be unique.'))}(e),e},[n,t])),E=f((0,a.useState)(function(){return function(e){var r,n=e.defaultValue,t=e.tabValues;if(0===t.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!b({value:n,tabValues:t}))throw Error('Docusaurus error: The has a defaultValue "'.concat(n,'" but none of its children has the corresponding value. Available values are: ').concat(t.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return n}var a=null!==(r=t.find(function(e){return e.default}))&&void 0!==r?r:t[0];if(!a)throw Error("Unexpected error: 0 tabValues");return a.value}({defaultValue:k,tabValues:A})}),2),I=E[0],T=E[1];var V=f((o=(i={queryString:void 0!==S&&S,groupId:P}).queryString,p=i.groupId,v=(0,l.k6)(),g=function(e){var r=e.queryString,n=void 0!==r&&r,t=e.groupId;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=t?t:null}({queryString:void 0!==o&&o,groupId:p}),[(0,s._X)(g),(0,a.useCallback)(function(e){if(!!g){var r,n,t=new URLSearchParams(v.location.search);t.set(g,e),v.replace((r=function(e){for(var r=1;rd});var t=n("24246"),a=n("27378"),i=n("96700"),o=n("3620");let l="apiTable_e8hp";function c(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n