Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ const ANALYTICS_EVENTS = {
ERROR: "error",
};

/**
* @penify
* Calculates the sum of two numbers
* @param a The first number
* @param b The second number
* @returns The sum of a and b
*/
export default function App({ Component, pageProps }: AppProps) {
const router = useRouter();
const [isMobile, setIsMobile] = useState(false);
Expand Down Expand Up @@ -127,6 +134,12 @@ export default function App({ Component, pageProps }: AppProps) {
inHouseAnalytics(ANALYTICS_EVENTS.PAGE_VIEW, {
main: "main_page",
});
/**
* Handles route changes by logging them and tracking page views, time spent on previous pages,
* and sending analytics events to Google Analytics (GA), Mixpanel, and in-house analytics.
*
* @param {string} url - The URL of the new page being navigated to.
*/
const handleRouteChange = (url: string) => {
// Log only on actual route changes

Expand Down