Add audit analytics and campaign metrics

This commit is contained in:
2026-06-05 21:43:43 +02:00
parent 70951789d2
commit df8ca1f049
12 changed files with 737 additions and 20 deletions

View File

@@ -0,0 +1,29 @@
import { fetchRybbitAuditAnalytics } from "@/lib/rybbit-analytics";
export async function GET(request: Request) {
const url = new URL(request.url);
const auditPath = url.searchParams.get("path") ?? "";
if (!auditPath.startsWith("/audit/")) {
return Response.json({
ok: false,
error: "Audit-Pfad fehlt.",
data: null,
}, { status: 400 });
}
const result = await fetchRybbitAuditAnalytics({
apiUrl: process.env.RYBBIT_API_URL,
apiKey: process.env.RYBBIT_API_KEY,
siteId: process.env.NEXT_PUBLIC_RYBBIT_SITE_ID,
auditPath,
startDate: url.searchParams.get("startDate") ?? undefined,
endDate: url.searchParams.get("endDate") ?? undefined,
});
if (!result.ok) {
return Response.json({ ok: false, error: result.error, data: result.data });
}
return Response.json({ ok: true, data: result.data });
}

View File

@@ -1,10 +1,5 @@
import { DashboardPlaceholderPage } from "@/components/dashboard-placeholder-page";
import { AnalyticsDashboard } from "@/components/analytics/analytics-dashboard";
export default function AnalyticsPage() {
return (
<DashboardPlaceholderPage
description="Kampagnenmetriken und Rybbit-Daten folgen in TASK-17 und TASK-19."
title="Analytics"
/>
);
return <AnalyticsDashboard />;
}