Skip to content

Install and configure Vercel Web Analytics#3

Draft
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/install-and-configure-vercel-w-f6xam5
Draft

Install and configure Vercel Web Analytics#3
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/install-and-configure-vercel-w-f6xam5

Conversation

@vercel

@vercel vercel Bot commented Mar 22, 2026

Copy link
Copy Markdown

Vercel Web Analytics Installation

Successfully installed and configured Vercel Web Analytics for the rtro.GIO project.

Changes Made

1. Package Installation

  • Installed @vercel/analytics package (v2.0.1) via npm
  • Updated package.json to include the new dependency
  • Updated package-lock.json with all transitive dependencies

2. Analytics Configuration

  • Modified: index.html

    • Added Vercel Web Analytics script tags in the <head> section
    • Placed after existing Speed Insights configuration
    • Uses the HTML/Static Sites implementation method from official docs
  • Modified: admin.html

    • Added identical Vercel Web Analytics script tags
    • Ensures analytics tracking on both customer and admin pages

Implementation Details

Following the official Vercel documentation (https://vercel.com/docs/analytics/quickstart), I implemented the HTML/Static Sites approach since this is a vanilla HTML/JavaScript project (not a framework-based application).

The implementation adds two script tags to each HTML file:

  1. Initialization script that creates the window.va function queue
  2. Deferred loading of the analytics script from /_vercel/insights/script.js

This approach is identical to how Speed Insights was already configured in the project, maintaining consistency with existing patterns.

Next Steps

To activate Web Analytics:

  1. Deploy this code to Vercel using vercel deploy
  2. Enable Web Analytics in your Vercel project dashboard (Analytics section)
  3. After deployment, analytics data will start appearing in your dashboard

The analytics will track page views and user interactions automatically once enabled in the Vercel dashboard.


View Project · Web Analytics

Created by retromadee with Vercel Agent

## Vercel Web Analytics Installation

Successfully installed and configured Vercel Web Analytics for the rtro.GIO project.

### Changes Made

**1. Package Installation**
- Installed `@vercel/analytics` package (v2.0.1) via npm
- Updated `package.json` to include the new dependency
- Updated `package-lock.json` with all transitive dependencies

**2. Analytics Configuration**
- **Modified: `index.html`**
  - Added Vercel Web Analytics script tags in the `<head>` section
  - Placed after existing Speed Insights configuration
  - Uses the HTML/Static Sites implementation method from official docs
  
- **Modified: `admin.html`**
  - Added identical Vercel Web Analytics script tags
  - Ensures analytics tracking on both customer and admin pages

### Implementation Details

Following the official Vercel documentation (https://vercel.com/docs/analytics/quickstart), I implemented the HTML/Static Sites approach since this is a vanilla HTML/JavaScript project (not a framework-based application).

The implementation adds two script tags to each HTML file:
1. Initialization script that creates the `window.va` function queue
2. Deferred loading of the analytics script from `/_vercel/insights/script.js`

This approach is identical to how Speed Insights was already configured in the project, maintaining consistency with existing patterns.

### Next Steps

To activate Web Analytics:
1. Deploy this code to Vercel using `vercel deploy`
2. Enable Web Analytics in your Vercel project dashboard (Analytics section)
3. After deployment, analytics data will start appearing in your dashboard

The analytics will track page views and user interactions automatically once enabled in the Vercel dashboard.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Mar 22, 2026

Copy link
Copy Markdown
Author

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rtogio Ready Ready Preview, Comment Mar 22, 2026 4:42pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants