diff --git a/.env.production b/.env.production index f5403d7..f786082 100644 --- a/.env.production +++ b/.env.production @@ -4,3 +4,7 @@ NODE_ENV=production # API Configuration NEXT_PUBLIC_API_URL=https://api.filamenteka.rs/api +# Matomo Analytics Configuration +NEXT_PUBLIC_MATOMO_URL=https://analytics.demirix.dev +NEXT_PUBLIC_MATOMO_SITE_ID=7 + diff --git a/app/layout.tsx b/app/layout.tsx index daa3437..65d1d53 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -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({ {children} + {process.env.NEXT_PUBLIC_MATOMO_URL && process.env.NEXT_PUBLIC_MATOMO_SITE_ID && ( + + )} ) diff --git a/app/page.tsx b/app/page.tsx index 107be45..768b61c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -4,6 +4,7 @@ import { useState, useEffect } from 'react'; import { FilamentTableV2 } from '../src/components/FilamentTableV2'; import { Filament } from '../src/types/filament'; import { filamentService } from '../src/services/api'; +import { trackEvent } from '../src/components/MatomoAnalytics'; export default function Home() { const [filaments, setFilaments] = useState([]); @@ -103,7 +104,10 @@ export default function Home() {
{mounted ? (