Skip to content

Add Vercel Web Analytics integration - #13

Draft
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/vercel-web-analytics-integrati-b0snaj
Draft

Add Vercel Web Analytics integration#13
vercel[bot] wants to merge 1 commit into
mainfrom
vercel/vercel-web-analytics-integrati-b0snaj

Conversation

@vercel

@vercel vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

Implemented Vercel Web Analytics for Jekyll project

Summary

Successfully installed and configured Vercel Web Analytics for this Jekyll static site following the latest official documentation from https://vercel.com/docs/analytics/quickstart.

Changes Made

Modified Files:

  • _includes/head.html - Added Vercel Web Analytics tracking scripts

Implementation Details:

Since this is a Jekyll static site (not a Node.js/npm-based project), I used the vanilla JavaScript approach recommended in the Vercel documentation for static HTML sites.

Added the following to _includes/head.html (lines 17-19):

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

The analytics initialization script creates the window.va function that queues analytics calls, and the deferred script loads the Vercel Insights tracking script from /_vercel/insights/script.js.

Why This Approach:

  1. Framework-Specific: Jekyll is a Ruby-based static site generator that doesn't use npm or JavaScript frameworks like React/Next.js. The vanilla JavaScript approach is the correct method for static HTML sites.

  2. No Package Manager Required: Since Jekyll generates static HTML, there's no need to install the @vercel/analytics npm package. The analytics script is loaded directly from Vercel's CDN.

  3. Placement: The script was added to _includes/head.html which is included in all layout templates (index.html, page.html, post.html, etc.), ensuring analytics tracking on all pages.

  4. Non-Intrusive: The implementation preserves all existing functionality and scripts, adding only the minimal required code for analytics tracking.

Next Steps (To Be Done in Vercel Dashboard):

  1. Enable Web Analytics in the Vercel project dashboard
  2. Deploy the site to activate tracking
  3. Verify tracking by checking browser Network tab for requests to /_vercel/insights/view
  4. View analytics data in the Vercel dashboard after users visit the site

Testing:

  • Verified the HTML syntax is correct
  • Confirmed the script tags were properly added to the head include file
  • The analytics script follows the official Vercel documentation exactly

View Project · Web Analytics

Created by opott with Vercel Agent

Implemented Vercel Web Analytics for Jekyll project

# Summary
Successfully installed and configured Vercel Web Analytics for this Jekyll static site following the latest official documentation from https://vercel.com/docs/analytics/quickstart.

# Changes Made

## Modified Files:
- `_includes/head.html` - Added Vercel Web Analytics tracking scripts

## Implementation Details:
Since this is a Jekyll static site (not a Node.js/npm-based project), I used the vanilla JavaScript approach recommended in the Vercel documentation for static HTML sites.

Added the following to `_includes/head.html` (lines 17-19):
```javascript
<script>
  window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>
```

The analytics initialization script creates the `window.va` function that queues analytics calls, and the deferred script loads the Vercel Insights tracking script from `/_vercel/insights/script.js`.

# Why This Approach:
1. **Framework-Specific**: Jekyll is a Ruby-based static site generator that doesn't use npm or JavaScript frameworks like React/Next.js. The vanilla JavaScript approach is the correct method for static HTML sites.

2. **No Package Manager Required**: Since Jekyll generates static HTML, there's no need to install the `@vercel/analytics` npm package. The analytics script is loaded directly from Vercel's CDN.

3. **Placement**: The script was added to `_includes/head.html` which is included in all layout templates (index.html, page.html, post.html, etc.), ensuring analytics tracking on all pages.

4. **Non-Intrusive**: The implementation preserves all existing functionality and scripts, adding only the minimal required code for analytics tracking.

# Next Steps (To Be Done in Vercel Dashboard):
1. Enable Web Analytics in the Vercel project dashboard
2. Deploy the site to activate tracking
3. Verify tracking by checking browser Network tab for requests to `/_vercel/insights/view`
4. View analytics data in the Vercel dashboard after users visit the site

# Testing:
- Verified the HTML syntax is correct
- Confirmed the script tags were properly added to the head include file
- The analytics script follows the official Vercel documentation exactly

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

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown
Author

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

Project Deployment Actions Updated (UTC)
refractfoundation Ready Ready Preview, Comment Jun 17, 2026 9:23pm

@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

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