commit ff83e86f0bc0c422ce4f332de7bfe30e5644a2ce
parent e1e4e9557d0c90794bb2609eb81682fabe40975e
Author: Michael Neuper <michael@michaelneuper.com>
Date: Wed, 28 Oct 2026 10:42:03 +0200
remove google analytics
Diffstat:
2 files changed, 0 insertions(+), 29 deletions(-)
diff --git a/src/components/frame/Analytics.astro b/src/components/frame/Analytics.astro
@@ -1,27 +0,0 @@
----
-// Google Analytics, as on the Hugo site: production builds only, so local work
-// isn't counted.
-const GA_ID = "G-BLX24KP7CS";
----
-{import.meta.env.PROD && (
- <script is:inline define:vars={{ GA_ID }}>
- window.dataLayer = window.dataLayer || [];
- function gtag() { dataLayer.push(arguments); }
- gtag("js", new Date());
- gtag("config", GA_ID);
- // gtag.js is about 180 KB compressed, several times the page's own scripts, so
- // it's only fetched once the page has loaded and gone idle, rather than
- // competing with the page's files for the network and the CPU.
- // The calls above wait in dataLayer until then. A visit that leaves sooner
- // isn't counted.
- const load = () => {
- const s = document.createElement("script");
- s.async = true;
- s.src = `https://www.googletagmanager.com/gtag/js?id=${GA_ID}`;
- document.head.append(s);
- };
- const idle = () => (window.requestIdleCallback ? requestIdleCallback(load, { timeout: 2000 }) : setTimeout(load, 300));
- if (document.readyState === "complete") idle();
- else addEventListener("load", idle, { once: true });
- </script>
-)}
diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro
@@ -5,7 +5,6 @@
import TopBar from "../components/frame/TopBar.astro";
import Modeline from "../components/frame/Modeline.astro";
import Help from "../components/frame/Help.astro";
-import Analytics from "../components/frame/Analytics.astro";
import "../styles/fonts.css";
import "../styles/themes.css";
import "../styles/base.css";
@@ -57,7 +56,6 @@ const {
if (t) document.documentElement.dataset.theme = t;
} catch (e) {}
</script>
-<Analytics />
<slot name="head" />
</head>
<!-- Reading the source? Good instinct. flag{view_source_is_recon} -->