Vercel Analytics & Speed Insights
Monitor traffic and Core Web Vitals with zero-config Vercel Analytics and Speed Insights.
Vercel provides built-in analytics and real-user monitoring (RUM) for sites deployed on their platform. Boltdocs injects the required scripts automatically when you enable them in your config.
Quick Start
Step 1: Enable analytics in boltdocs.config.ts
export default defineConfig({
integrations: {
analytics: {
vercel: {
analytics: true,
speedInsights: true,
},
},
},
})
Step 2: Deploy to Vercel
Both scripts are only injected in production builds (NODE_ENV === 'production'). They will not load during local development or preview deployments.
Configuration Reference
| Property | Type | Default | Description |
|---|---|---|---|
analytics | boolean | true | Enables Vercel Web Analytics (page views, unique visitors). |
speedInsights | boolean | true | Enables Vercel Speed Insights (Core Web Vitals, LCP, CLS, INP). |
Minimal Example
integrations: {
analytics: {
vercel: {
analytics: true,
},
},
}
Both Enabled (Default)
integrations: {
analytics: {
vercel: {
analytics: true,
speedInsights: true,
},
},
}
How It Works
When enabled, Boltdocs injects two script snippets into the <head> of every page at build time:
- Vercel Analytics —
<script defer src="/_vercel/insights/script.js"> - Speed Insights —
<script defer src="/_vercel/speed-insights/script.js">
Vercel automatically handles the data collection pipeline on their edge network. No additional API keys or configuration are required.
Troubleshooting
Scripts not appearing in development
This is expected. Both scripts are only injected in production builds. Run boltdocs build && boltdocs preview to test locally.
Data not showing in Vercel dashboard
- Ensure your project is deployed on Vercel's production environment
- Verify the scripts are present by checking the page source of your deployed site
- Allow up to 24 hours for data to appear in the dashboard