Add Matomo analytics tracking with Suspense fix
- Created MatomoAnalytics component with page view and event tracking - Fixed Next.js build issue by wrapping useSearchParams in Suspense - Added tracking for user interactions: - Search functionality - Table sorting - Filter changes (material, finish, color) - Dark mode toggles - Admin login success/failure - Admin filament create/update actions - Updated Amplify environment variables via AWS CLI - Analytics URL: https://analytics.demirix.dev (Site ID: 7) - Only loads when environment variables are set 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Metadata } from 'next'
|
||||
import '../src/styles/index.css'
|
||||
import { BackToTop } from '../src/components/BackToTop'
|
||||
import { MatomoAnalytics } from '../src/components/MatomoAnalytics'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Filamenteka',
|
||||
@@ -46,6 +47,12 @@ export default function RootLayout({
|
||||
<body suppressHydrationWarning>
|
||||
{children}
|
||||
<BackToTop />
|
||||
{process.env.NEXT_PUBLIC_MATOMO_URL && process.env.NEXT_PUBLIC_MATOMO_SITE_ID && (
|
||||
<MatomoAnalytics
|
||||
matomoUrl={process.env.NEXT_PUBLIC_MATOMO_URL}
|
||||
siteId={process.env.NEXT_PUBLIC_MATOMO_SITE_ID}
|
||||
/>
|
||||
)}
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user