From 447fedf92c4dc8c14fc6c507737bc2c10b220429 Mon Sep 17 00:00:00 2001 From: Vercel Date: Mon, 16 Nov 2026 20:39:40 +0000 Subject: [PATCH] Install and Configure Vercel Web Analytics ## Vercel Web Analytics Installation Successfully installed and configured Vercel Web Analytics for this static HTML website. ### Project Framework This is a **static HTML site** hosted on GitHub Pages (not a Next.js or React project). The site uses plain HTML/CSS/JavaScript without a build process or package.json. ### Implementation Approach Following the latest Vercel Web Analytics documentation (November 2024), I used the **CDN-based approach** recommended for static sites: ```html ``` ### Files Modified Added the Vercel Web Analytics script tag to all 6 HTML pages in the project: 1. **index.html** - Main control center dashboard 2. **projects/index.html** - Project registry page 3. **profile/preview.html** - Profile UI preview page 4. **auth/index.html** - Authentication page 5. **auth/ocodejs.html** - OCodeJS auth variant 6. **security/token-vault/public/index.html** - Token vault page ### Key Points - **No npm package required**: For static HTML sites, the CDN approach (`@vercel/analytics` package is only needed for framework-based projects with build systems) - **Placement**: Added the script in the `` section of each file, immediately after the existing Speed Insights script - **Preserved existing code**: The site already had Vercel Speed Insights configured (`/_vercel/insights/script.js`), which is a separate product from Web Analytics - **Both services now active**: - Speed Insights: monitors performance metrics (Core Web Vitals) - Web Analytics: tracks pageviews and custom events ### Verification Once deployed to Vercel, analytics will automatically start collecting: - Page views - User sessions - Navigation patterns - Custom events (if configured later) ### Next Steps After deployment, you can: 1. Enable Web Analytics in your Vercel project dashboard (if not already enabled) 2. View analytics data at vercel.com/[your-project]/analytics 3. Configure custom events if needed using the `window.va()` function 4. Set up audience segmentation filters The implementation follows official Vercel documentation and best practices for static HTML sites. Co-authored-by: Vercel --- auth/index.html | 2 ++ auth/ocodejs.html | 2 ++ index.html | 2 ++ profile/preview.html | 4 +++- projects/index.html | 4 +++- security/token-vault/public/index.html | 2 ++ 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/auth/index.html b/auth/index.html index ef285e2..840ff00 100644 --- a/auth/index.html +++ b/auth/index.html @@ -60,6 +60,8 @@ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + +
diff --git a/auth/ocodejs.html b/auth/ocodejs.html index ef285e2..840ff00 100644 --- a/auth/ocodejs.html +++ b/auth/ocodejs.html @@ -60,6 +60,8 @@ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + +
diff --git a/index.html b/index.html index b7d0645..5ad5908 100644 --- a/index.html +++ b/index.html @@ -19,6 +19,8 @@ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + +
diff --git a/profile/preview.html b/profile/preview.html index 518ec97..d18798c 100644 --- a/profile/preview.html +++ b/profile/preview.html @@ -12,6 +12,8 @@ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + +
OCode.js / Profile
UI PREVIEW · SAMPLE DATA
@@ -36,4 +38,4 @@ $('cancel').onclick=()=>$('modal').classList.remove('open'); $('save').onclick=()=>{$('displayName').textContent=$('nameInput').value.trim()||'OCode Developer';$('readmeName').textContent=$('displayName').textContent;$('bio').textContent=$('bioInput').value;$('modal').classList.remove('open');}; $('modal').addEventListener('click',e=>{if(e.target===$('modal'))$('modal').classList.remove('open')}); - \ No newline at end of file + diff --git a/projects/index.html b/projects/index.html index e6cd60c..8e10ce0 100644 --- a/projects/index.html +++ b/projects/index.html @@ -15,6 +15,8 @@ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + +
@@ -57,4 +59,4 @@ }catch(error){root.replaceChildren(el("div","empty","Không tải được projects.registry.json: "+error.message));count.textContent="Registry unavailable"} - \ No newline at end of file + diff --git a/security/token-vault/public/index.html b/security/token-vault/public/index.html index ed13dec..6452323 100644 --- a/security/token-vault/public/index.html +++ b/security/token-vault/public/index.html @@ -21,6 +21,8 @@ window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; + +
OCode.js / SECURITY