From b556e7f12d32c9bc7c85b287c1ec8ee990558d6d Mon Sep 17 00:00:00 2001 From: Nikita Karamov Date: Sun, 26 Mar 2023 16:18:23 +0200 Subject: [PATCH] Remove GoatCounter --- CHANGELOG.md | 4 ++++ src/count.js | 35 ----------------------------------- src/pages/index.astro | 1 - 3 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 src/count.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 5908b09..0f03ea9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,10 @@ Some changes came with the name change: static files, all you need is to run the Node server. - when developing, the API endpoint can now be tested locally +### Removed + +- GoatCounter analytics. I will no longer track the visitors of s2f.kytta.dev + ## [2.4.5] - 2023-06-17 ### Fixed diff --git a/src/count.js b/src/count.js deleted file mode 100644 index a71193b..0000000 --- a/src/count.js +++ /dev/null @@ -1,35 +0,0 @@ -/*! - * © 2022 Nikita Karamov - * Licensed under AGPL v3 or later - */ - -// This is the analytics code for Share₂Fedi. It just sends a beacon -// to GoatCounter with hardcoded path. This is way more lightweight, performant -// and privacy-friendly than the default GC script. -if ( - window.location.host === "s2f.kytta.dev" || - window.location.host === "share2fedi.kytta.dev" -) { - // eslint-disable-next-line unicorn/prefer-top-level-await - fetch("//gc.zgo.at/", { method: "HEAD" }).then((result) => { - // Check if the default GC URL resolves - // This allows us to not track people with ad blockers - if (!result.ok) { - return; - } - - const screen = encodeURIComponent( - [ - window.screen.width, - window.screen.height, - window.devicePixelRatio || 1, - ].join(","), - ); - - const random = encodeURIComponent(Math.random().toString(36).slice(2)); - - navigator.sendBeacon( - `https://share2fedi.goatcounter.com/count?p=%2F&s=${screen}&b=0&rnd=${random}`, - ); - }); -} diff --git a/src/pages/index.astro b/src/pages/index.astro index 162895a..8fff033 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -33,7 +33,6 @@ const prefilledInstance = searchParameters.get("instance"); href="https://s2f.kytta.dev/" /> -