Commit 8f581ff
committed
Enable Vercel Speed Insights tracking
# Vercel Speed Insights Implementation
## Summary
Successfully implemented Vercel Speed Insights for the HTML-based project following the official Vercel documentation.
## Changes Made
### Modified Files
- **index.html** - Added Vercel Speed Insights script tags
## Implementation Details
According to the Vercel Speed Insights guide for HTML projects, I added the required script tags before the closing `</body>` tag:
1. **Initialization Script**: Added the `window.si` initialization function that queues Speed Insights calls
2. **Tracking Script**: Added the deferred loading of the Speed Insights script from `/_vercel/speed-insights/script.js`
## Additional Fixes
The original `index.html` file was missing closing `</body>` and `</html>` tags. These have been added to ensure proper HTML structure along with the Speed Insights implementation.
## Code Added
```html
<script>
window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
</script>
<script defer src="/_vercel/speed-insights/script.js"></script>
</body>
</html>
```
## Next Steps
Once deployed to Vercel with Speed Insights enabled:
1. The `/_vercel/speed-insights/*` routes will be automatically added
2. Performance metrics will start being collected
3. Data can be viewed in the Vercel dashboard under the Speed Insights tab
## Notes
- No package installation was required for the HTML implementation
- The scripts are loaded with the `defer` attribute to avoid blocking page rendering
- Speed Insights will only function when deployed to Vercel with the feature enabled in the project settings
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>1 parent a05cccc commit 8f581ff
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
0 commit comments