7 lines
319 B
TypeScript
7 lines
319 B
TypeScript
import Script from "next/script";
|
|
export default function Analytics({ host, domain }: { host?: string; domain?: string }) {
|
|
if (!domain) return null;
|
|
const h = host || "https://plausible.io";
|
|
return <Script defer data-domain={domain} src={`${h.replace(/\/$/, "")}/js/script.js`} strategy="afterInteractive" />;
|
|
}
|