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
@@ -25,6 +25,32 @@ const nextConfig = {
|
||||
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
|
||||
},
|
||||
|
||||
// Proxy reverso para bypass de adblockers (Rybbit Analytics)
|
||||
// Inclui suporte para session replay e error tracking
|
||||
async rewrites() {
|
||||
const rybbitHost = process.env.NEXT_PUBLIC_RYBBIT_HOST || "https://analytics.evandro.dev.br/api";
|
||||
|
||||
return [
|
||||
{
|
||||
source: "/analytics/:match*",
|
||||
destination: `${rybbitHost}/:match*`,
|
||||
},
|
||||
// Endpoints específicos para garantir funcionamento de replay e error tracking
|
||||
{
|
||||
source: "/analytics/v1/replay",
|
||||
destination: `${rybbitHost}/v1/replay`,
|
||||
},
|
||||
{
|
||||
source: "/analytics/v1/vitals",
|
||||
destination: `${rybbitHost}/v1/vitals`,
|
||||
},
|
||||
{
|
||||
source: "/analytics/v1/errors",
|
||||
destination: `${rybbitHost}/v1/errors`,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
// Headers de segurança e performance
|
||||
async headers() {
|
||||
return [
|
||||
|
||||
Reference in new issue
Block a user