Skip to content

Commit

Permalink
Feat : google analytics 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
teagu123 committed Jul 4, 2024
1 parent cd025c7 commit dd1e33e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
38 changes: 29 additions & 9 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="naver-site-verification" content="54136140958bc6d89ff61491854437d62562ec4f" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#FFFFFF" />
<meta
name="llkelionuniv"
content="멋쟁이사자처럼 대학 사이트"
name="naver-site-verification"
content="54136140958bc6d89ff61491854437d62562ec4f"
/>
<title>
사단법인 멋쟁이사자처럼
</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<meta name="theme-color" content="#FFFFFF" />
<meta name="llkelionuniv" content="멋쟁이사자처럼 대학 사이트" />
<title>사단법인 멋쟁이사자처럼</title>
</head>

<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-5JPCK23B');
</script>

<body>
<div id="root"></div>
</body>
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-5JPCK23B"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe
></noscript>
</html>
9 changes: 0 additions & 9 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import router from './Router';
import './styles/font.css';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import ReactGA from 'react-ga';

// stale time 10분으로 설정
const queryClient = new QueryClient({
Expand All @@ -21,14 +20,6 @@ const queryClient = new QueryClient({
},
});

//Google Analytics
// const gaTrackingId = process.env.REACT_APP_GOOGLE_ANALYTICS_TRACKING_ID; // 환경 변수에 저장된 추적ID 가져오기

// if (gaTrackingId) {
// ReactGA.initialize(gaTrackingId, { debug: true });
// ReactGA.pageview(window.location.pathname);
// }

const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement,
);
Expand Down

0 comments on commit dd1e33e

Please sign in to comment.