From 2ebdca548438f5327bb48367b1bb67c3e065c35e Mon Sep 17 00:00:00 2001 From: m5r Date: Sat, 29 Apr 2023 07:45:51 +0200 Subject: [PATCH] remove fathom analytics --- app/config/config.server.ts | 5 ----- app/features/core/hooks/use-fathom.ts | 20 -------------------- app/root.tsx | 16 ---------------- package-lock.json | 11 ----------- package.json | 1 - 5 files changed, 53 deletions(-) delete mode 100644 app/features/core/hooks/use-fathom.ts diff --git a/app/config/config.server.ts b/app/config/config.server.ts index 57aad49..5c6fb62 100644 --- a/app/config/config.server.ts +++ b/app/config/config.server.ts @@ -40,7 +40,6 @@ invariant( typeof process.env.WEB_PUSH_VAPID_PUBLIC_KEY === "string", `Please define the "WEB_PUSH_VAPID_PUBLIC_KEY" environment variable`, ); -invariant(typeof process.env.FATHOM_SITE_ID === "string", `Please define the "FATHOM_SITE_ID" environment variable`); invariant( typeof process.env.MAILCHIMP_API_KEY === "string", `Please define the "MAILCHIMP_API_KEY" environment variable`, @@ -81,10 +80,6 @@ export default { webhookId: process.env.DISCORD_WEBHOOK_ID, webhookToken: process.env.DISCORD_WEBHOOK_TOKEN, }, - fathom: { - siteId: process.env.FATHOM_SITE_ID, - domain: process.env.FATHOM_CUSTOM_DOMAIN, - }, mailchimp: { apiKey: process.env.MAILCHIMP_API_KEY, audienceId: process.env.MAILCHIMP_AUDIENCE_ID, diff --git a/app/features/core/hooks/use-fathom.ts b/app/features/core/hooks/use-fathom.ts deleted file mode 100644 index 0a160d8..0000000 --- a/app/features/core/hooks/use-fathom.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { useEffect } from "react"; -import { useLocation } from "@remix-run/react"; -import * as Fathom from "fathom-client"; - -export default function useFathom() { - const location = useLocation(); - - useEffect(() => { - const { fathom, app } = window.shellphoneConfig; - Fathom.load(fathom.siteId, { - spa: "history", - url: fathom.domain ? `https://${fathom.domain}/script.js` : undefined, - includedDomains: [app.baseUrl.replace("https://", "")], - }); - }, []); - - useEffect(() => { - Fathom.trackPageview(); - }, [location]); -} diff --git a/app/root.tsx b/app/root.tsx index 8fcdadf..96b3112 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -13,7 +13,6 @@ import { } from "@remix-run/react"; import config from "~/config/config.server"; -import useFathom from "~/features/core/hooks/use-fathom"; import Logo from "~/features/core/components/logo"; import styles from "./styles/tailwind.css"; @@ -31,13 +30,6 @@ type LoaderData = { sentry: { dsn?: string; }; - fathom: { - siteId: string; - domain?: string; - }; - app: { - baseUrl: string; - }; }; }; export const loader: LoaderFunction = () => { @@ -46,20 +38,12 @@ export const loader: LoaderFunction = () => { sentry: { dsn: config.sentry.dsn, }, - fathom: { - siteId: config.fathom.siteId, - domain: config.fathom.domain, - }, - app: { - baseUrl: config.app.baseUrl, - }, }, }); }; export default function App() { const { shellphoneConfig } = useLoaderData(); - useFathom(); return ( diff --git a/package-lock.json b/package-lock.json index 152e85b..a320dea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,6 @@ "clsx": "1.1.1", "compression": "1.7.4", "express": "4.18.1", - "fathom-client": "3.5.0", "ioredis": "5.0.6", "jotai": "1.7.0", "luxon": "2.4.0", @@ -10733,11 +10732,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fathom-client": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/fathom-client/-/fathom-client-3.5.0.tgz", - "integrity": "sha512-BiRDS9Q9a8Zma0H717FWC5cvf545K/CsxBpxKT22TcSl1EbRhhlHWIJgrdeiQUfdorBK2ppy09TwMOhRsbos/A==" - }, "node_modules/fault": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", @@ -30426,11 +30420,6 @@ "reusify": "^1.0.4" } }, - "fathom-client": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/fathom-client/-/fathom-client-3.5.0.tgz", - "integrity": "sha512-BiRDS9Q9a8Zma0H717FWC5cvf545K/CsxBpxKT22TcSl1EbRhhlHWIJgrdeiQUfdorBK2ppy09TwMOhRsbos/A==" - }, "fault": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", diff --git a/package.json b/package.json index 7a5ea65..1741900 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ "clsx": "1.1.1", "compression": "1.7.4", "express": "4.18.1", - "fathom-client": "3.5.0", "ioredis": "5.0.6", "jotai": "1.7.0", "luxon": "2.4.0",