Aswanth
2025-05-24 6d49d975598cd7f48e2b7347c2b83d8aac6a2f56
quartz/plugins/emitters/componentResources.ts
@@ -128,14 +128,8 @@
      const umamiScript = document.createElement("script");
      umamiScript.src = "${cfg.analytics.host ?? "https://analytics.umami.is"}/script.js";
      umamiScript.setAttribute("data-website-id", "${cfg.analytics.websiteId}");
      umamiScript.setAttribute("data-auto-track", "false");
      umamiScript.setAttribute("data-auto-track", "true");
      umamiScript.defer = true;
      umamiScript.onload = () => {
        umami.track();
        document.addEventListener("nav", () => {
          umami.track();
        });
      };
      document.head.appendChild(umamiScript);
    `)
@@ -165,14 +159,10 @@
      posthog.init('${cfg.analytics.apiKey}', {
        api_host: '${cfg.analytics.host ?? "https://app.posthog.com"}',
        capture_pageview: false,
      })\`
      posthogScript.onload = () => {
      });
      document.addEventListener('nav', () => {
        posthog.capture('$pageview', { path: location.pathname });
        document.addEventListener('nav', () => {
          posthog.capture('$pageview', { path: location.pathname });
        });
      };
      })\`
      document.head.appendChild(posthogScript);
    `)