Skip to content

Commit 00610bb

Browse files
authored
Send our own pageLoad, routeChanged events (#2044)
1 parent 210b0d2 commit 00610bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/.vitepress/theme/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ export default {
1717
}
1818
};
1919

20-
async function enableAnalytics(router) {
20+
function enableAnalytics(router) {
2121
if (typeof location === "undefined" || location.origin !== "https://observablehq.com") return;
22-
const {pageLoad, routeChanged} = await import("https://events.observablehq.com/client.js?pageLoad");
2322
let pageLoaded = false;
24-
watch(router.route, () => {
23+
watch(router.route, async () => {
24+
const {pageLoad, routeChanged} = await import("https://events.observablehq.com/client.js");
2525
if (pageLoaded) {
2626
routeChanged();
2727
} else {

0 commit comments

Comments
 (0)