Skip to content

Set up Vercel Web Analytics for your project#1

Draft
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/set-up-vercel-web-analytics-fo-io2zqz
Draft

Set up Vercel Web Analytics for your project#1
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/set-up-vercel-web-analytics-fo-io2zqz

Conversation

@vercel

@vercel vercel Bot commented Jan 27, 2026

Copy link
Copy Markdown

Vercel Web Analytics Implementation

Summary

Successfully implemented Vercel Web Analytics for the plain HTML portfolio website.

Changes Made

Modified Files:

  • index.html - Added Vercel Web Analytics tracking scripts to the <head> section

Implementation Details

For this plain HTML website, I added the Vercel Web Analytics tracking scripts directly to the HTML file as specified in the documentation for HTML projects.

The following scripts were added to the <head> section of index.html (after the font links and before the styles):

<script>
    window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>

How It Works

  1. The first script initializes the window.va function and queue for analytics tracking
  2. The second script loads the Vercel analytics tracking script asynchronously (using defer)
  3. The tracking script will be served from /_vercel/insights/script.js after deployment to Vercel

Important Notes

  • No package installation required: For plain HTML sites, no npm package (@vercel/analytics) is needed
  • No route support: The HTML implementation does not include automatic route tracking like framework-specific implementations
  • Activation: Analytics will start working after the next deployment to Vercel
  • Verification: After deployment, check the browser's Network tab for requests to /_vercel/insights/view when visiting pages

Next Steps

To complete the setup:

  1. Enable Web Analytics in the Vercel dashboard:

    • Go to your project in the Vercel dashboard
    • Click the "Analytics" tab
    • Click "Enable" in the dialog
  2. Deploy the site to Vercel:

    vercel deploy
  3. Once deployed, visit your site and verify analytics are working by:

    • Opening browser DevTools
    • Checking the Network tab
    • Looking for Fetch/XHR requests to /_vercel/insights/view
  4. View analytics data in the Vercel dashboard under the Analytics tab

Technical Decisions

  • Placed the analytics scripts in the <head> section for early initialization
  • Used the defer attribute on the script tag to ensure it doesn't block page rendering
  • Positioned the scripts after the font links to maintain proper resource loading order
  • Kept the inline initialization script before the deferred external script as per Vercel documentation

View Project · Web Analytics

Created by cellrishi-9616 with Vercel Agent

# Vercel Web Analytics Implementation

## Summary
Successfully implemented Vercel Web Analytics for the plain HTML portfolio website.

## Changes Made

### Modified Files:
- **index.html** - Added Vercel Web Analytics tracking scripts to the `<head>` section

## Implementation Details

For this plain HTML website, I added the Vercel Web Analytics tracking scripts directly to the HTML file as specified in the documentation for HTML projects.

The following scripts were added to the `<head>` section of index.html (after the font links and before the styles):

```html
<script>
    window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>
```

## How It Works

1. The first script initializes the `window.va` function and queue for analytics tracking
2. The second script loads the Vercel analytics tracking script asynchronously (using `defer`)
3. The tracking script will be served from `/_vercel/insights/script.js` after deployment to Vercel

## Important Notes

- **No package installation required**: For plain HTML sites, no npm package (@vercel/analytics) is needed
- **No route support**: The HTML implementation does not include automatic route tracking like framework-specific implementations
- **Activation**: Analytics will start working after the next deployment to Vercel
- **Verification**: After deployment, check the browser's Network tab for requests to `/_vercel/insights/view` when visiting pages

## Next Steps

To complete the setup:

1. Enable Web Analytics in the Vercel dashboard:
   - Go to your project in the Vercel dashboard
   - Click the "Analytics" tab
   - Click "Enable" in the dialog

2. Deploy the site to Vercel:
   ```bash
   vercel deploy
   ```

3. Once deployed, visit your site and verify analytics are working by:
   - Opening browser DevTools
   - Checking the Network tab
   - Looking for Fetch/XHR requests to `/_vercel/insights/view`

4. View analytics data in the Vercel dashboard under the Analytics tab

## Technical Decisions

- Placed the analytics scripts in the `<head>` section for early initialization
- Used the `defer` attribute on the script tag to ensure it doesn't block page rendering
- Positioned the scripts after the font links to maintain proper resource loading order
- Kept the inline initialization script before the deferred external script as per Vercel documentation

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

vercel Bot commented Jan 27, 2026

Copy link
Copy Markdown
Author

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

Project Deployment Review Updated (UTC)
my-website1 Ready Ready Preview, Comment Jan 27, 2026 6:36am

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