Skip to content

Add Vercel Web Analytics to your project#1

Draft
vercel[bot] wants to merge 1 commit intomainfrom
vercel/vercel-web-analytics-to-your-p-d7odk9
Draft

Add Vercel Web Analytics to your project#1
vercel[bot] wants to merge 1 commit intomainfrom
vercel/vercel-web-analytics-to-your-p-d7odk9

Conversation

@vercel
Copy link
Copy Markdown

@vercel vercel bot commented Mar 6, 2026

Vercel Web Analytics Implementation

Summary

Successfully implemented Vercel Web Analytics on the Firewatch Clock project, a plain HTML/CSS/JavaScript dashboard application.

Changes Made

Modified Files:

  • index.html - Added Vercel Web Analytics tracking scripts

Implementation Details:

Added the following code to the <head> section of index.html (after the style.css link):

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

Implementation Approach

Since this is a plain HTML website (no framework or build system), I followed the HTML implementation guide from the Vercel Web Analytics documentation:

  1. No package installation required - For plain HTML sites, the analytics work directly through script tags
  2. Script placement - Added the initialization script and deferred loading of the Vercel insights script in the HTML head
  3. Route support - Note that the plain HTML implementation does not include automatic route detection

How It Works

  1. The first script initializes a window.va function that queues analytics calls
  2. The second script loads the actual Vercel insights tracking code asynchronously
  3. Once deployed to Vercel, the /_vercel/insights/script.js endpoint will be available and begin tracking page views and visitor data

Next Steps for Deployment

After deploying to Vercel:

  1. Enable Web Analytics in the Vercel dashboard (Project → Analytics tab → Enable)
  2. Deploy the site with these changes
  3. Verify the implementation by checking for /_vercel/insights/view requests in the browser's Network tab
  4. View analytics data in the Vercel dashboard under the Analytics tab

Testing Notes

  • This is a static HTML site with no build process
  • No dependencies to install or lock files to update
  • The analytics script will only function when deployed to Vercel (it will fail gracefully in local development)
  • Users can verify proper setup by checking browser DevTools Network tab for the insights script requests after deployment

View Project · Web Analytics

Created by cosmosynth with Vercel Agent

# Vercel Web Analytics Implementation

## Summary
Successfully implemented Vercel Web Analytics on the Firewatch Clock project, a plain HTML/CSS/JavaScript dashboard application.

## Changes Made

### Modified Files:
- **index.html** - Added Vercel Web Analytics tracking scripts

### Implementation Details:
Added the following code to the `<head>` section of index.html (after the style.css link):

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

## Implementation Approach

Since this is a plain HTML website (no framework or build system), I followed the HTML implementation guide from the Vercel Web Analytics documentation:

1. **No package installation required** - For plain HTML sites, the analytics work directly through script tags
2. **Script placement** - Added the initialization script and deferred loading of the Vercel insights script in the HTML head
3. **Route support** - Note that the plain HTML implementation does not include automatic route detection

## How It Works

1. The first script initializes a `window.va` function that queues analytics calls
2. The second script loads the actual Vercel insights tracking code asynchronously
3. Once deployed to Vercel, the `/_vercel/insights/script.js` endpoint will be available and begin tracking page views and visitor data

## Next Steps for Deployment

After deploying to Vercel:
1. Enable Web Analytics in the Vercel dashboard (Project → Analytics tab → Enable)
2. Deploy the site with these changes
3. Verify the implementation by checking for `/_vercel/insights/view` requests in the browser's Network tab
4. View analytics data in the Vercel dashboard under the Analytics tab

## Testing Notes

- This is a static HTML site with no build process
- No dependencies to install or lock files to update
- The analytics script will only function when deployed to Vercel (it will fail gracefully in local development)
- Users can verify proper setup by checking browser DevTools Network tab for the insights script requests after deployment

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

vercel bot commented Mar 6, 2026

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

Project Deployment Actions Updated (UTC)
outpost Ready Ready Preview, Comment Mar 6, 2026 7:13am

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