Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE] Google Analytics를 레이아웃에 넣어 작동되게 한다. #716

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions frontend/src/routers/GoogleAnalytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Outlet } from 'react-router-dom';

import useGaTracker from '@/hooks/useGaTracker';

const GoogleAnalytics = () => {
useGaTracker();

return <Outlet />;
};

export default GoogleAnalytics;
2 changes: 2 additions & 0 deletions frontend/src/routers/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createBrowserRouter, Outlet } from 'react-router-dom';

import FooterLayout from '@/components/_common/layout/FooterLayout';
import { ROUTE_PATH } from '@/constants/routePath';
import GoogleAnalytics from '@/routers/GoogleAnalytics';

const MainPage = React.lazy(() => import('@/pages/MainPage'));
const ChecklistListPage = React.lazy(() => import('@/pages/ChecklistListPage'));
Expand All @@ -22,6 +23,7 @@ const router = createBrowserRouter([
{
element: (
<Suspense>
<GoogleAnalytics />
<Outlet />
</Suspense>
),
Expand Down
Loading