Skip to content

Commit 2a3325b

Browse files
authored
Merge pull request #440 from checkly/docs/vercel-web-analytics
Add Vercel Web Analytics to docs site
2 parents 9741c73 + c7b1f33 commit 2a3325b

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

docs.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
},
2323
{
2424
"src": "/unify-tracking.js"
25+
},
26+
{
27+
"src": "/vercel-analytics.js"
2528
}
2629
],
2730
"integrations": {

vercel-analytics.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Vercel Web Analytics
2+
// These docs are served under checklyhq.com/docs via a Vercel rewrite, so the
3+
// insights script and its beacon only resolve at the domain root. A path
4+
// relative to /docs 404s.
5+
(function () {
6+
if (window.__vercelInsightsAdded) return;
7+
window.__vercelInsightsAdded = true;
8+
9+
var script = document.createElement('script');
10+
script.src = '/_vercel/insights/script.js';
11+
document.head.appendChild(script);
12+
})();

0 commit comments

Comments
 (0)