Skip to content

Commit 3c3ca42

Browse files
committed
analytics: add Vercel Analytics + Speed Insights to dashboard
1 parent 0079e53 commit 3c3ca42

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

front/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,23 @@ <h2>What you're seeing</h2>
430430
</div>
431431
</div>
432432

433+
<!-- Vercel Analytics + Speed Insights. Only loaded on the Vercel
434+
deploy — the same files also serve from the Dream server on the
435+
Oracle VM, where /_vercel/* would 404. The window.va / window.si
436+
shims buffer auto-instrumentation events until the deferred
437+
scripts execute. -->
438+
<script>
439+
if (location.hostname.endsWith('.vercel.app')) {
440+
window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
441+
window.si = window.si || function () { (window.siq = window.siq || []).push(arguments); };
442+
for (const path of ['/_vercel/insights/script.js', '/_vercel/speed-insights/script.js']) {
443+
const s = document.createElement('script');
444+
s.defer = true;
445+
s.src = path;
446+
document.head.appendChild(s);
447+
}
448+
}
449+
</script>
433450
<script src="app.js"></script>
434451
</body>
435452

0 commit comments

Comments
 (0)