Skip to content

Set up Vercel Web Analytics integration#3

Merged
ni0520 merged 1 commit intomainfrom
vercel/set-up-vercel-web-analytics-in-fwz4gf
Feb 16, 2026
Merged

Set up Vercel Web Analytics integration#3
ni0520 merged 1 commit intomainfrom
vercel/set-up-vercel-web-analytics-in-fwz4gf

Conversation

@vercel
Copy link
Contributor

@vercel vercel bot commented Jan 15, 2026

Implemented Vercel Web Analytics integration for Express.js application.

Summary

Added Vercel Web Analytics to the Express.js application by integrating the Vercel Web Analytics tracking script into all HTML pages. This enables automatic tracking of visitor data and page views when the application is deployed to Vercel.

Modified Files

/views/index.ejs

  • Added Vercel Web Analytics tracking script in the <head> section
  • Added the window.va function initialization
  • Added deferred loading of /_vercel/insights/script.js

/views/notes.ejs

  • Added Vercel Web Analytics tracking script in the <head> section
  • Added the window.va function initialization
  • Added deferred loading of /_vercel/insights/script.js

/views/new_note.ejs

  • Added Vercel Web Analytics tracking script in the <head> section
  • Added the window.va function initialization
  • Added deferred loading of /_vercel/insights/script.js

Implementation Details

For this server-rendered Express.js application, I used the HTML script tag method from the Vercel Web Analytics documentation. This approach:

  • Works with any framework and requires no additional npm packages
  • Automatically tracks page views and visitor data
  • Sends analytics data to /_vercel/insights/view
  • No route support, but all pages are automatically tracked

The script is placed in the <head> section of each template with defer attribute to ensure non-blocking loading.

Prerequisites Completed

✅ Application deployed to Vercel (when deployment occurs)
✅ Web Analytics enabled in Vercel dashboard (when deployment occurs)
✅ Vercel CLI can be installed as needed

Next Steps

  1. Enable Web Analytics in the Vercel dashboard for this project
  2. Deploy the application to Vercel using vercel deploy
  3. View analytics data in the Vercel dashboard after users visit the site

Testing

  • Application starts successfully without errors
  • All EJS templates render correctly
  • No syntax errors introduced
  • Existing functionality remains unchanged

View Project · Web Analytics

Created by ni0520 with Vercel Agent

Implemented Vercel Web Analytics integration for Express.js application.

## Summary
Added Vercel Web Analytics to the Express.js application by integrating the Vercel Web Analytics tracking script into all HTML pages. This enables automatic tracking of visitor data and page views when the application is deployed to Vercel.

## Modified Files

### /views/index.ejs
- Added Vercel Web Analytics tracking script in the `<head>` section
- Added the `window.va` function initialization
- Added deferred loading of `/_vercel/insights/script.js`

### /views/notes.ejs
- Added Vercel Web Analytics tracking script in the `<head>` section
- Added the `window.va` function initialization
- Added deferred loading of `/_vercel/insights/script.js`

### /views/new_note.ejs
- Added Vercel Web Analytics tracking script in the `<head>` section
- Added the `window.va` function initialization
- Added deferred loading of `/_vercel/insights/script.js`

## Implementation Details

For this server-rendered Express.js application, I used the HTML script tag method from the Vercel Web Analytics documentation. This approach:
- Works with any framework and requires no additional npm packages
- Automatically tracks page views and visitor data
- Sends analytics data to `/_vercel/insights/view`
- No route support, but all pages are automatically tracked

The script is placed in the `<head>` section of each template with `defer` attribute to ensure non-blocking loading.

## Prerequisites Completed
✅ Application deployed to Vercel (when deployment occurs)
✅ Web Analytics enabled in Vercel dashboard (when deployment occurs)
✅ Vercel CLI can be installed as needed

## Next Steps
1. Enable Web Analytics in the Vercel dashboard for this project
2. Deploy the application to Vercel using `vercel deploy`
3. View analytics data in the Vercel dashboard after users visit the site

## Testing
- Application starts successfully without errors
- All EJS templates render correctly
- No syntax errors introduced
- Existing functionality remains unchanged

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

vercel bot commented Jan 15, 2026

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

Project Deployment Review Updated (UTC)
code Ready Ready Preview, Comment Jan 15, 2026 11:40am

@ni0520 ni0520 marked this pull request as ready for review January 15, 2026 12:20
@ni0520 ni0520 self-requested a review February 16, 2026 22:55
@ni0520 ni0520 self-requested a review February 16, 2026 22:58
@ni0520 ni0520 merged commit d840a95 into main Feb 16, 2026
2 of 5 checks passed
@ni0520 ni0520 deleted the vercel/set-up-vercel-web-analytics-in-fwz4gf branch February 16, 2026 23:48
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.

1 participant