data-peek/apps/docs
vercel[bot] cffce4beee
Install Vercel Web Analytics (#130)
## 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>
2026-04-02 17:57:36 +05:30
..
content/docs Fix case-sensitive table names and cross-database identifier quoting (#126) 2026-04-02 12:13:37 +05:30
public Fix case-sensitive table names and cross-database identifier quoting (#126) 2026-04-02 12:13:37 +05:30
src Install Vercel Web Analytics (#130) 2026-04-02 17:57:36 +05:30
.gitignore feat: add docs 2025-11-30 22:28:59 +05:30
package.json Install Vercel Web Analytics (#130) 2026-04-02 17:57:36 +05:30
README.md feat: add docs 2025-11-30 22:28:59 +05:30
source.config.ts feat: add docs 2025-11-30 22:28:59 +05:30
tsconfig.json feat: add docs 2025-11-30 22:28:59 +05:30
vite.config.ts docs: disable prerendering in Vite config. 2025-11-30 22:35:49 +05:30

docs

This is a Tanstack Start application generated with Create Fumadocs.

Run development server:

npm run dev
# or
pnpm dev
# or
yarn dev