feat(analytics): integrate Rybbit Analytics with error tracking and session replay
- Added rewrites in next.config.mjs for Rybbit Analytics to bypass adblockers. - Implemented ErrorBoundary and ErrorTracking components in layout.tsx for enhanced error handling. - Included a script for analytics tracking in the root layout. - Updated NutritionGrid in product page to handle potential undefined nutrition data.
This commit is contained in:
1 parent
c99c82c837
commit
0eeb63bbde
6 files changed
+188
-7
No files matched your search
+16
-1
@@ -1,7 +1,10 @@
|
||||
import "./globals.css";
|
||||
import { Metadata } from "next";
|
||||
import { Inter } from "next/font/google";
|
||||
import Script from "next/script";
|
||||
import { ThemeProvider } from "@/app/providers";
|
||||
import { ErrorBoundary } from "@/app/components/ErrorBoundary";
|
||||
import { ErrorTracking } from "@/app/components/ErrorTracking";
|
||||
|
||||
// Use Inter como fallback já que é uma fonte similar à Geist
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
@@ -79,7 +82,19 @@ export default function RootLayout({
|
||||
return (
|
||||
<html lang="pt-BR" suppressHydrationWarning className={inter.className}>
|
||||
<body className="min-h-screen bg-background antialiased">
|
||||
<ThemeProvider>{children}</ThemeProvider>
|
||||
<ErrorBoundary>
|
||||
<ThemeProvider>
|
||||
{children}
|
||||
<ErrorTracking />
|
||||
</ThemeProvider>
|
||||
</ErrorBoundary>
|
||||
<Script
|
||||
src="/analytics/script.js"
|
||||
data-site-id="undefined"
|
||||
data-replay="true"
|
||||
data-error-tracking="true"
|
||||
strategy="afterInteractive"
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user