From 165a03944eaa98ccf4ff6a409bfc01e185f021c4 Mon Sep 17 00:00:00 2001 From: Vercel Date: Wed, 17 Jun 2026 21:23:10 +0000 Subject: [PATCH] Add Vercel Web Analytics integration 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 ``` 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 --- _includes/head.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/_includes/head.html b/_includes/head.html index 27d8614..4887234 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -13,6 +13,10 @@ + +