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 />