Skip to content

Commit

Permalink
Patch analytics pageLoad event for now (#2043)
Browse files Browse the repository at this point in the history
  • Loading branch information
visnup committed Apr 3, 2024
1 parent e5fb68d commit 210b0d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/index.ts
Expand Up @@ -19,8 +19,8 @@ export default {

async function enableAnalytics(router) {
if (typeof location === "undefined" || location.origin !== "https://observablehq.com") return;
const {pageLoad, routeChanged} = await import("https://events.observablehq.com/client.js");
let pageLoaded;
const {pageLoad, routeChanged} = await import("https://events.observablehq.com/client.js?pageLoad");
let pageLoaded = false;
watch(router.route, () => {
if (pageLoaded) {
routeChanged();
Expand Down

0 comments on commit 210b0d2

Please sign in to comment.