Skip to content

Commit 8f581ff

Browse files
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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,3 +533,11 @@ <h5 class="font-semibold mt-3">Passi suggeriti:</h5>
533533
});
534534

535535
</script>
536+
537+
<script>
538+
window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
539+
</script>
540+
<script defer src="/_vercel/speed-insights/script.js"></script>
541+
542+
</body>
543+
</html>

0 commit comments

Comments
 (0)