mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-11-14 23:20:51 -05:00
vercel analytics ➡️ umami
This commit is contained in:
18
app/analytics.tsx
Normal file
18
app/analytics.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import Script from "next/script";
|
||||
|
||||
const Analytics = () => {
|
||||
if (!process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID || process.env.NEXT_PUBLIC_VERCEL_ENV !== "production") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Script
|
||||
src="/_stream/u/script.js" // see next.config.ts rewrite
|
||||
strategy="afterInteractive"
|
||||
data-website-id={process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID}
|
||||
data-domains={process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default Analytics;
|
||||
Reference in New Issue
Block a user