Skip to content

Install and configure Vercel Web Analytics#4

Draft
vercel[bot] wants to merge 1 commit intomainfrom
vercel/install-and-configure-vercel-w-f2iqkw
Draft

Install and configure Vercel Web Analytics#4
vercel[bot] wants to merge 1 commit intomainfrom
vercel/install-and-configure-vercel-w-f2iqkw

Conversation

@vercel
Copy link
Copy Markdown

@vercel vercel bot commented Mar 30, 2026

Vercel Web Analytics Implementation

Successfully installed and configured Vercel Web Analytics for the OpenPinas project.

What was implemented

Added Vercel Web Analytics tracking script to all key HTML pages in the project using the official Vercel-recommended approach for static HTML sites.

Files Modified

The following 12 HTML files were updated with the analytics script tag:

  1. index.html - Main landing page
  2. dynasties-network-visualization.html - Dynasty network visualization
  3. business-connections-network-visualization.html - Business connections visualization
  4. elite-schools-influence-visualization.html - Elite schools influence map
  5. startup-ecosystem-visualization.html - Startup ecosystem visualization
  6. when-to-go-manila.html - Philippines travel timing guide
  7. regional-visualization.html - Regional analysis page
  8. sources-and-related-projects.html - Sources and related projects page
  9. corruption-tracker/index.html - Corruption tracker main page
  10. dynasties/index.html - Dynasties news archive
  11. interactive-timeline/index.html - Interactive timeline page
  12. weekly-reviews/index.html - Weekly reviews index

Implementation Details

Script Tag Added

<script defer src="/_vercel/insights/script.js"></script>

Placement

The script tag was added in the <head> section of each HTML file, after the stylesheet links and before the closing </head> tag. The defer attribute ensures the analytics script loads asynchronously without blocking page rendering.

Framework Approach

This project is a static HTML site deployed on Vercel. According to the official Vercel documentation retrieved from https://vercel.com/docs/analytics/quickstart and the example at https://github.com/vercel/examples/blob/main/solutions/html/index.html, the recommended approach for static HTML sites is to add the script tag with the path /_vercel/insights/script.js.

This path is automatically served by Vercel's platform when Web Analytics is enabled in the project dashboard. No package installation or build process changes were required.

Verification

  • ✅ All 12 key HTML files now include the analytics script
  • ✅ Validation script passes (bash validate-openpinas.sh)
  • ✅ HTML syntax is valid
  • ✅ Script placement follows Vercel best practices (defer attribute, head section)

How It Works

Once deployed to Vercel:

  1. The /_vercel/insights/script.js path will be automatically served by Vercel's infrastructure
  2. The script will track page views and other analytics events
  3. Data will be available in the Vercel dashboard under Analytics
  4. Analytics are privacy-friendly and first-party (no third-party trackers)

Next Steps

After merging this PR:

  1. Verify Web Analytics is enabled in the Vercel project dashboard
  2. Deploy the changes to production
  3. Check browser Network tab for successful requests to /_vercel/insights/view
  4. Monitor analytics data in the Vercel dashboard

Notes

  • No package.json or dependencies were added (not needed for static HTML sites)
  • No build process changes required (project uses buildCommand: "true" in vercel.json)
  • Analytics script will only function when deployed on Vercel (not in local development)
  • For debugging, Vercel provides script.debug.js variant that logs events to console

View Project · Web Analytics

Created by dat-angel with Vercel Agent

# Vercel Web Analytics Implementation

Successfully installed and configured Vercel Web Analytics for the OpenPinas project.

## What was implemented

Added Vercel Web Analytics tracking script to all key HTML pages in the project using the official Vercel-recommended approach for static HTML sites.

## Files Modified

The following 12 HTML files were updated with the analytics script tag:

1. **index.html** - Main landing page
2. **dynasties-network-visualization.html** - Dynasty network visualization
3. **business-connections-network-visualization.html** - Business connections visualization
4. **elite-schools-influence-visualization.html** - Elite schools influence map
5. **startup-ecosystem-visualization.html** - Startup ecosystem visualization
6. **when-to-go-manila.html** - Philippines travel timing guide
7. **regional-visualization.html** - Regional analysis page
8. **sources-and-related-projects.html** - Sources and related projects page
9. **corruption-tracker/index.html** - Corruption tracker main page
10. **dynasties/index.html** - Dynasties news archive
11. **interactive-timeline/index.html** - Interactive timeline page
12. **weekly-reviews/index.html** - Weekly reviews index

## Implementation Details

### Script Tag Added
```html
<script defer src="/_vercel/insights/script.js"></script>
```

### Placement
The script tag was added in the `<head>` section of each HTML file, after the stylesheet links and before the closing `</head>` tag. The `defer` attribute ensures the analytics script loads asynchronously without blocking page rendering.

### Framework Approach
This project is a static HTML site deployed on Vercel. According to the official Vercel documentation retrieved from https://vercel.com/docs/analytics/quickstart and the example at https://github.com/vercel/examples/blob/main/solutions/html/index.html, the recommended approach for static HTML sites is to add the script tag with the path `/_vercel/insights/script.js`.

This path is automatically served by Vercel's platform when Web Analytics is enabled in the project dashboard. No package installation or build process changes were required.

## Verification

- ✅ All 12 key HTML files now include the analytics script
- ✅ Validation script passes (bash validate-openpinas.sh)
- ✅ HTML syntax is valid
- ✅ Script placement follows Vercel best practices (defer attribute, head section)

## How It Works

Once deployed to Vercel:
1. The `/_vercel/insights/script.js` path will be automatically served by Vercel's infrastructure
2. The script will track page views and other analytics events
3. Data will be available in the Vercel dashboard under Analytics
4. Analytics are privacy-friendly and first-party (no third-party trackers)

## Next Steps

After merging this PR:
1. Verify Web Analytics is enabled in the Vercel project dashboard
2. Deploy the changes to production
3. Check browser Network tab for successful requests to `/_vercel/insights/view`
4. Monitor analytics data in the Vercel dashboard

## Notes

- No package.json or dependencies were added (not needed for static HTML sites)
- No build process changes required (project uses `buildCommand: "true"` in vercel.json)
- Analytics script will only function when deployed on Vercel (not in local development)
- For debugging, Vercel provides `script.debug.js` variant that logs events to console

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

vercel bot commented Mar 30, 2026

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

Project Deployment Actions Updated (UTC)
openpinas Ready Ready Preview, Comment, Open in v0 Mar 30, 2026 2:54pm

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