# Vercel Web Analytics Implementation
## Summary
Successfully implemented Vercel Web Analytics on all HTML pages in the MQL5 Trading Automation project.
## Changes Made
### Files Modified (5 files):
1. **index.html** (root) - Main landing page
2. **dashboard/index.html** - Dashboard view
3. **docs/index.html** - Documentation page
4. **offline.html** - PWA offline fallback page
5. **sw-inspector.html** - Service Worker inspection tool
### Implementation Details
Added Vercel Web Analytics tracking scripts to the `<head>` section of each HTML file:
```html
<script>
window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>
```
### Why This Approach?
- This is a plain HTML project (no JavaScript framework like React, Next.js, or Vue)
- Following the official Vercel Web Analytics guide for HTML sites
- The analytics script is added directly to HTML files without requiring any npm packages
- The `defer` attribute ensures the script doesn't block page rendering
- The `window.va` initialization allows analytics to be tracked even before the main script loads
## How It Works
1. The inline script creates a queue (`window.vaq`) that collects analytics calls
2. The deferred script (`/_vercel/insights/script.js`) is loaded asynchronously from Vercel's CDN
3. Once loaded, the script processes the queued analytics events
4. Analytics automatically tracks page views and user interactions
## Next Steps
To enable analytics on the deployed site:
1. Deploy this code to Vercel
2. Go to the Vercel dashboard for this project
3. Navigate to the **Analytics** tab
4. Click **Enable** to activate Web Analytics
5. After the next deployment, the `/_vercel/insights/*` routes will be available
6. Verify by checking the browser's Network tab for requests to `/_vercel/insights/view`
## Testing
To verify the implementation works:
- Deploy to Vercel
- Visit any page on the deployed site
- Open browser DevTools → Network tab
- Look for Fetch/XHR requests to `/_vercel/insights/view`
- These requests indicate analytics is tracking page views
## Notes
- No package.json changes needed (this is a static HTML site)
- No build process required
- Analytics will only work on the deployed Vercel site (not in local development)
- All 5 HTML pages now have tracking enabled for complete coverage
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
- Replaced #667eea with #4f46e5 to meet WCAG AA contrast standards.
- Updated hover color to #4338ca.
- Added aria-label to Service Worker update button.
- Updated manifest.json theme color.
- Add .toast CSS to index.html and dashboard/index.html
- Add toast HTML structure (role="alert")
- Replace window.confirm() with toast show/hide logic
- Improve accessibility and UX for app updates
Wrapped emojis in <span> tags with role="img" and aria-label to improve accessibility for screen readers. This ensures icons are announced correctly (e.g., "Rocket", "Chart") rather than as characters or ignored.
Affected files:
- index.html
- dashboard/index.html
- offline.html
- sw-inspector.html
- Add `.btn:focus-visible` styles for better keyboard navigation visibility.
- Add `rel="noopener noreferrer"` and `aria-label` to external links for security and accessibility.
- Add `role="button"` to placeholder links (`href="#"`) for semantic correctness.
- Replace blocking `alert()` with a non-blocking button text change ("Coming Soon! 🚧") for better UX.
- Apply changes to both `index.html` and `dashboard/index.html`.
This commit copies `dashboard/index.html` to `index.html` (root) and `docs/index.html` to ensure that the GitHub Pages site loads correctly regardless of the source configuration (Root, Docs, or Custom Workflow). It also adds `.nojekyll` to prevent Jekyll processing issues.