Repository navigation
Install and Configure Vercel Web Analytics #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,8 @@ | |
| window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; | ||
| </script> | ||
| <script defer src="/_vercel/insights/script.js"></script> | ||
| <!-- Vercel Web Analytics --> | ||
| <script defer src="https://cdn.vercel-insights.com/v1/script.js"></script> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Analytics counts are inflated When both the existing and CDN loaders execute on a page, Remove one loader so each page initializes Web Analytics only once. Also at Prompt for AI agentsIn `index.html` at line 23:
**Analytics counts are inflated**
When both the existing and CDN loaders execute on a page, `/_vercel/insights/script.js` and the CDN script both initialize tracking, recording duplicate pageviews and events and inflating dashboard totals.
Remove one loader so each page initializes Web Analytics only once.
Also at `projects/index.html:19`, `profile/preview.html:16`, `auth/index.html:64`, `auth/ocodejs.html:64`, `security/token-vault/public/index.html:25`.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Dashboard sections go untracked When visitors navigate between dashboard sections, Emit an analytics event when Prompt for AI agentsIn `index.html` at line 23:
**Dashboard sections go untracked**
When visitors navigate between dashboard sections, `navigate()` changes the rendered view without changing the URL or emitting an analytics event, so the script records the initial load but misses section visits.
Emit an analytics event when `navigate()` switches dashboard sections. |
||
| </head> | ||
| <body> | ||
| <div class="app"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,8 @@ | |
| window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); }; | ||
| </script> | ||
| <script defer src="/_vercel/insights/script.js"></script> | ||
| <!-- Vercel Web Analytics --> | ||
| <script defer src="https://cdn.vercel-insights.com/v1/script.js"></script> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Vault credentials can be exposed When the external analytics script is compromised or altered while a user signs in, the script runs with access to the page DOM and can capture and exfiltrate the master password, exposing the credentials it protects. Do not load the third-party analytics script on the credential-entry page. Also at Prompt for AI agentsIn `security/token-vault/public/index.html` at line 25:
**Vault credentials can be exposed**
When the external analytics script is compromised or altered while a user signs in, the script runs with access to the page DOM and can capture and exfiltrate the master password, exposing the credentials it protects.
Do not load the third-party analytics script on the credential-entry page.
Also at `auth/index.html:64`, `auth/ocodejs.html:64`.There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Worker visits go untracked When visitors use the deployed Token Vault Worker routes, the Worker serves embedded Add the analytics script to the HTML served by the Worker routes. Prompt for AI agentsIn `security/token-vault/public/index.html` at line 25:
**Worker visits go untracked**
When visitors use the deployed Token Vault Worker routes, the Worker serves embedded `LOGIN_HTML` and `VAULT_HTML` for `/` and `/vault`, not `public/index.html`, so the added script never loads and those visits are not tracked.
Add the analytics script to the HTML served by the Worker routes. |
||
| </head> | ||
| <body><main> | ||
| <div class="brand"><b>OCode.js</b> / SECURITY</div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 High · Production visits go untracked
When the production site remains on GitHub Pages and the connected Vercel project is unbuildable because the repository lacks a root
package.json, the generic CDN script has no GitHub Pages collection endpoint or project-specific association, so production visits do not appear in Vercel Analytics.Configure analytics for the actual production host and a functioning project, or serve the site from that project.
Also at
projects/index.html:19,profile/preview.html:16,auth/index.html:64,auth/ocodejs.html:64,security/token-vault/public/index.html:25.Prompt for AI agents