mirror of
https://github.com/Rohithgilla12/data-peek
synced 2026-04-21 21:07:17 +00:00
## Vercel Web Analytics Installation
Successfully installed and configured Vercel Web Analytics for the data-peek documentation site.
### Implementation Details
**Framework Identified:** TanStack Start (React-based framework with Nitro)
**Changes Made:**
1. **Package Installation**
- Added `@vercel/analytics` (v2.0.1) to `apps/docs/package.json`
- Package installed using pnpm as per project's package manager
- Updated `pnpm-lock.yaml` to reflect new dependency
2. **Analytics Configuration**
- Modified `apps/docs/src/routes/__root.tsx`:
- Added import: `import { Analytics } from "@vercel/analytics/react"`
- Added `<Analytics />` component to the RootDocument body, placed before the `<Scripts />` component
**Implementation Approach:**
Following the official Vercel Analytics documentation (fetched from https://vercel.com/docs/analytics/quickstart), I:
- Used the React-specific package `@vercel/analytics/react`
- Added the `<Analytics />` component to the root layout where it can track all page views
- Positioned it before the `<Scripts />` component in the body to ensure proper initialization
- The component automatically detects the environment (production/development) via NODE_ENV
- In production (when deployed to Vercel), the analytics will be active; in development, it will use debug mode
**Build Verification:**
✅ Build completed successfully (`pnpm run build`)
✅ No TypeScript errors related to the Analytics integration
✅ Package installed without conflicts
✅ Existing functionality preserved
**Next Steps for Deployment:**
To enable analytics data collection, the project owner needs to:
1. Visit the Vercel dashboard for this project
2. Navigate to the Analytics section
3. Click "Enable" to activate Web Analytics
4. Deploy the updated code to Vercel
Once deployed and enabled in the dashboard, analytics will automatically track page views and web vitals.
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
39 lines
No EOL
1 KiB
JSON
39 lines
No EOL
1 KiB
JSON
{
|
|
"name": "docs",
|
|
"private": true,
|
|
"sideEffects": false,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite dev",
|
|
"build": "vite build",
|
|
"start": "node .output/server/index.mjs",
|
|
"types:check": "fumadocs-mdx && tsc --noEmit",
|
|
"postinstall": "fumadocs-mdx"
|
|
},
|
|
"dependencies": {
|
|
"@tanstack/react-router": "^1.134.12",
|
|
"@tanstack/react-router-devtools": "^1.134.12",
|
|
"@tanstack/react-start": "^1.134.12",
|
|
"@vercel/analytics": "^2.0.1",
|
|
"fumadocs-core": "16.2.1",
|
|
"fumadocs-mdx": "14.0.4",
|
|
"fumadocs-ui": "16.2.1",
|
|
"lucide-static": "^0.552.0",
|
|
"react": "^19.2.0",
|
|
"react-dom": "^19.2.0",
|
|
"tailwind-merge": "^3.3.1",
|
|
"vite": "^7.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/vite": "^4.1.16",
|
|
"@types/mdx": "^2.0.13",
|
|
"@types/node": "^24.10.0",
|
|
"@types/react": "^19.2.2",
|
|
"@types/react-dom": "^19.2.2",
|
|
"@vitejs/plugin-react": "^5.1.0",
|
|
"nitro": "3.0.1-alpha.1",
|
|
"tailwindcss": "^4.1.16",
|
|
"typescript": "^5.9.3",
|
|
"vite-tsconfig-paths": "^5.1.4"
|
|
}
|
|
} |