feat: umami migration

This commit is contained in:
2026-02-07 01:11:28 +01:00
parent 29d474a102
commit 9f6168592c
27 changed files with 3310 additions and 193 deletions

View File

@@ -5,6 +5,8 @@ import "../globals.css";
import { NextIntlClientProvider } from "next-intl";
import { getMessages } from "next-intl/server";
import { notFound } from "next/navigation";
import AnalyticsProvider from "@/components/analytics/AnalyticsProvider";
import { config } from "@/lib/config";
const inter = Inter({
subsets: ["latin"],
@@ -105,6 +107,13 @@ export default async function RootLayout({
},
};
// Track pageview on the server
// This is safe to call here because layout is a Server Component
const services = (
await import("@/lib/services/create-services.server")
).getServerAppServices();
services.analytics.trackPageview();
return (
<html lang={locale} className={`${inter.variable}`}>
<head>
@@ -115,6 +124,7 @@ export default async function RootLayout({
</head>
<body className="antialiased">
<NextIntlClientProvider messages={messages}>
<AnalyticsProvider websiteId={config.analytics.umami.websiteId} />
<Layout>{children}</Layout>
</NextIntlClientProvider>
</body>