This repository has been archived on 2024-07-16. You can view files and clone it, but cannot push or open issues or pull requests.
www.local-ip.sh/app/hooks/use-fathom.ts
2023-12-22 23:59:14 +01:00

19 lines
401 B
TypeScript

import { useEffect } from "react";
import { useLocation } from "@remix-run/react";
import * as Fathom from "fathom-client";
export default function useFathom() {
const location = useLocation();
useEffect(() => {
Fathom.load(window.siteConfig.fathom.siteId, {
spa: "history",
includedDomains: ["local-ip.sh"],
});
}, []);
useEffect(() => {
Fathom.trackPageview();
}, [location]);
}