← Back to Pull requests

Install and Configure Vercel Web Analytics #70

Open
unknown opened this pull request with 220 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 18, 2026 15:09 UTC
Author

Implemented Vercel Web Analytics for the Agentbox project.

Changes Made

1. Installed @vercel/analytics Package


  • Added @vercel/analytics version ^2.0.1 to the project dependencies

  • Ran npm install to update package-lock.json
  • 2. Configured Analytics in Base Layout


    Modified site/src/layouts/Base.astro:
  • Imported the Analytics component from @vercel/analytics/astro

  • Added the <Analytics /> component to the <head> section of the layout
  • Implementation Details

    Following the official Vercel Analytics documentation (fetched on 2026-11-18), I used the recommended approach for Astro projects:
    1. Installed the analytics package using npm
    2. Imported the Astro-specific Analytics component
    3. Placed it in the <head> section of the Base layout, which is used by all pages

    This ensures that analytics tracking is enabled across the entire site.

    Files Modified


  • site/package.json - Added @vercel/analytics dependency

  • site/package-lock.json - Updated with new dependency tree

  • site/src/layouts/Base.astro - Added Analytics import and component
  • Testing & Verification


  • ✅ npm run check - Passed with 0 errors, 0 warnings, 0 hints

  • ✅ npm run build - Build completed successfully in 1.14s

  • ✅ All existing functionality preserved
  • Next Steps


    To enable analytics data collection, you'll need to:
    1. Enable Web Analytics in your Vercel dashboard
    2. Deploy the site to Vercel using vercel deploy

    The analytics will automatically start collecting data once deployed on Vercel's platform.

    ---

    View Project · Web Analytics

    Created by Gerard Rovira (zurfyx) with Vercel Agent

    Diff: 220 lines (+165 / -55) across 2 files Reviewer: zurfyx Review duration: 17461m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.60) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 220 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.323
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #70"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 59.9% (MEDIUM) · Higher = larger blast radius
    59.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.9% · Safe to merge
    31.9%