Skip to content

Commit 11e9a5a

Browse files
committed
fix: analytics tracking
1 parent 209e909 commit 11e9a5a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Contact } from "@/components/sections/Contact";
1111
import { ThemeProvider } from "@/contexts/ThemeContext";
1212
import { MixerPanel } from "@/components/MixerPanel";
1313
import { Analytics } from "@vercel/analytics/react";
14+
import { track } from "@vercel/analytics";
1415
import { SpeedInsights } from "@vercel/speed-insights/react";
1516

1617
const App = () => {
@@ -19,7 +20,9 @@ const App = () => {
1920
useEffect(() => {
2021
const getRoute = () => (location.hash.replace("#", "") || "about").toLowerCase();
2122
const handleHashChange = () => {
22-
setCurrentPage(getRoute());
23+
const newPage = getRoute();
24+
setCurrentPage(newPage);
25+
track("Pageview", { path: window.location.pathname + window.location.hash });
2326
window.scrollTo({ top: 0, behavior: "auto" });
2427
};
2528
handleHashChange();

0 commit comments

Comments
 (0)