Skip to content

Commit 4dc275e

Browse files
authored
Merge pull request #2 from marklearst/feat/vercel-analytics
feat: add Vercel Web Analytics
2 parents abfc7ab + 97c65d2 commit 4dc275e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

assets/js/vercel-analytics.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Vercel Web Analytics initialization
2+
// https://vercel.com/docs/analytics
3+
window.va =
4+
window.va ||
5+
function () {
6+
(window.vaq = window.vaq || []).push(arguments);
7+
};
8+
9+
// Dynamically load the Vercel Analytics script
10+
(function () {
11+
var script = document.createElement('script');
12+
script.defer = true;
13+
script.src = '/_vercel/insights/script.js';
14+
document.head.appendChild(script);
15+
})();

docmd.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module.exports = {
2323
},
2424
autoTitleFromH1: true,
2525
copyCode: true,
26+
customJs: ["/assets/js/vercel-analytics.js"],
2627
navigation: [
2728
{ title: "Home", path: ".", icon: "home" },
2829
{

0 commit comments

Comments
 (0)