Skip to content

Commit 00944af

Browse files
authored
chore: 구글 애널리틱스 설정 (#76)
1 parent 5f0cd30 commit 00944af

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"js-cookie": "^3.0.5",
1717
"react": "^18.3.1",
1818
"react-dom": "^18.3.1",
19+
"react-ga4": "^2.1.0",
1920
"react-redux": "^9.1.2",
2021
"react-router-dom": "^6.24.0",
2122
"redux-persist": "^6.0.0",

src/App.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ import {theme} from './styles/theme/Theme';
55
import Home from '@pages/index/Home';
66
import Login from '@pages/index/Login';
77
import ProtectedRoute from './components/ProtectedRoute';
8+
import {useEffect} from 'react';
89

10+
import ReactGA from 'react-ga4';
11+
12+
function initializeAnalytics() {
13+
ReactGA.initialize(import.meta.env.VITE_GTM_ID);
14+
ReactGA.send({ hitType: 'pageview', page: '/' });
15+
}
916
function App() {
17+
useEffect(() => {
18+
initializeAnalytics();
19+
}, []);
1020
return (
1121
<ThemeProvider theme={theme}>
1222
<GlobalStyle />

src/components/LoginForm/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function LoginForm() {
2828
setRandomStudentId(generateRandomStudentId);
2929
};
3030
const handleCopyStudentId = () => {
31-
navigator.clipboard.writeText(randomStudentId)
31+
navigator.clipboard.writeText(randomStudentId.toString())
3232
.then(() => {
3333
alert('복사 완료!');
3434
})

src/components/common/FilterButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface ButtonProps {
1616
searchOption: string,
1717
) => Promise<void>;
1818
searchOption: string;
19-
isRegistrationStarted: boolean;
19+
isRegistrationStarted?: boolean;
2020
}
2121

2222
function FilterButton({

src/pages/index/Login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const FaqWrap = styled.div`
101101
}
102102
`;
103103

104-
const FooterWrap = styled.div`
104+
/*const FooterWrap = styled.div`
105105
${props => props.theme.texts.loginContent};
106106
letter-spacing: 0;
107107
> em {
@@ -114,6 +114,6 @@ const FooterWrap = styled.div`
114114
font-size: 1.2rem;
115115
margin: 0.7rem 0 3rem 0;
116116
}
117-
`;
117+
`;*/
118118

119119
export default Login;

0 commit comments

Comments
 (0)