Skip to content

Commit

Permalink
Update GoogleAnalytics.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
su-u committed Nov 17, 2023
1 parent f0695e5 commit 6dbeefa
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/components/common/GoogleAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Script from 'next/script';
import { useEffect, FC } from 'react';
import { usePathname, useSearchParams } from 'next/navigation';
import { existsGaId, GA_MEASUREMENT_ID, pageview } from '@/lib/gtag';
import { useRouter } from 'next/router';

const GoogleAnalytics: FC = () => {
const pathname = usePathname();
Expand All @@ -17,17 +16,6 @@ const GoogleAnalytics: FC = () => {
pageview(url);
}, [pathname, searchParams]);

const router = useRouter();
useEffect(() => {
const handleRouteChange = (url) => {
pageview(url);
};
router.events.on('routeChangeComplete', handleRouteChange);
return () => {
router.events.off('routeChangeComplete', handleRouteChange);
};
}, [router.events]);

return (
<>
<Script
Expand Down

1 comment on commit 6dbeefa

@vercel
Copy link

@vercel vercel bot commented on 6dbeefa Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tools-su-u-dev – ./

tools-su-u-dev-su-u.vercel.app
tools-su-u-dev-git-main-su-u.vercel.app
tools.su-u.dev
tools-su-u-dev.vercel.app

Please sign in to comment.