From 11e9a5af82fea571d5cb7cc8f258bd6eb33b7143 Mon Sep 17 00:00:00 2001 From: Dev Keshwani Date: Fri, 27 Feb 2026 16:05:04 +0530 Subject: [PATCH] fix: analytics tracking --- src/App.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index f0edeb8..e82b513 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,6 +11,7 @@ import { Contact } from "@/components/sections/Contact"; import { ThemeProvider } from "@/contexts/ThemeContext"; import { MixerPanel } from "@/components/MixerPanel"; import { Analytics } from "@vercel/analytics/react"; +import { track } from "@vercel/analytics"; import { SpeedInsights } from "@vercel/speed-insights/react"; const App = () => { @@ -19,7 +20,9 @@ const App = () => { useEffect(() => { const getRoute = () => (location.hash.replace("#", "") || "about").toLowerCase(); const handleHashChange = () => { - setCurrentPage(getRoute()); + const newPage = getRoute(); + setCurrentPage(newPage); + track("Pageview", { path: window.location.pathname + window.location.hash }); window.scrollTo({ top: 0, behavior: "auto" }); }; handleHashChange();