integrated umami analytics

This commit is contained in:
corgifist 2025-07-23 16:39:08 +03:00
parent 773c306cd7
commit edeff02256
2 changed files with 16 additions and 1 deletions

12
src/app/analytics.tsx Normal file
View File

@ -0,0 +1,12 @@
import { ReactNode } from "react";
// Powered by Umami (https://umami.is/)
export default function Analytics(): ReactNode {
if (process.env.NODE_ENV == "development") {
console.log("Analytics is disabled in development mode");
return (<></>);
}
return (
<script defer src={process.env.ANALYTICS_SCRIPT} data-website-id={process.env.ANALYTICS_WEBSITE_ID}/>
)
}

View File

@ -5,6 +5,7 @@ import { SidebarProvider } from "@/components/ui/sidebar";
import Dashboard from "@/components/dashboard";
import "./globals.css";
import ThemeProvider from "./theme-provider";
import Analytics from "./analytics";
const geist = Geist({
variable: "--font-geist",
@ -29,7 +30,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en" suppressHydrationWarning>
<head/>
<head>
<Analytics/>
</head>
<body className={`${geist.variable} ${geistMono.variable} antialiased`}>
<ThemeProvider>
<SidebarProvider>