remove fathom analytics

This commit is contained in:
m5r 2023-04-29 07:45:51 +02:00
parent 77e2ca5640
commit 2ebdca5484
5 changed files with 0 additions and 53 deletions

View File

@ -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,

View File

@ -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]);
}

View File

@ -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<LoaderData>();
useFathom();
return (
<Document>
<Outlet />

11
package-lock.json generated
View File

@ -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",

View File

@ -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",