Skip to content

Commit

Permalink
hotfix/ GA Error
Browse files Browse the repository at this point in the history
Hotfix / GA Error
  • Loading branch information
Seo0H committed Jun 9, 2023
2 parents 8e976e3 + 223b076 commit e275e8b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
56 changes: 41 additions & 15 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,46 @@ export default function App({ Component, pageProps, ...appProps }: AppProps) {
};

return (
<QueryClientProvider client={queryClient}>
<SearchProvider>
<ThemeProvider theme={theme}>
<GlobalStyle />
{getContent()}
<ReactQueryDevtools initialIsOpen={false} />
<Script
src='https://t1.kakaocdn.net/kakao_js_sdk/2.1.0/kakao.min.js'
integrity='sha384-dpu02ieKC6NUeKFoGMOKz6102CLEWi9+5RQjWSV0ikYSFFd8M3Wp2reIcquJOemx'
crossOrigin='anonymous'
onLoad={kakaoSDKInit}
/>
</ThemeProvider>
</SearchProvider>
</QueryClientProvider>
<>
{/* ms-clarity */}
<Script strategy='afterInteractive' id='ms-clarity'>
{`
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", '${process.env.NEXT_PUBLIC_CLARITY_KEY}');
`}
</Script>
{/* Google Analytics */}
<Script
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_ID}`}
/>
<Script id='google-analytics' strategy='afterInteractive'>
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.NEXT_PUBLIC_GA_ID}', {
page_path: window.location.pathname,
});
`}
</Script>
<QueryClientProvider client={queryClient}>
<SearchProvider>
<ThemeProvider theme={theme}>
<GlobalStyle />
{getContent()}
<ReactQueryDevtools initialIsOpen={false} />
<Script
src='https://t1.kakaocdn.net/kakao_js_sdk/2.1.0/kakao.min.js'
integrity='sha384-dpu02ieKC6NUeKFoGMOKz6102CLEWi9+5RQjWSV0ikYSFFd8M3Wp2reIcquJOemx'
crossOrigin='anonymous'
onLoad={kakaoSDKInit}
/>
</ThemeProvider>
</SearchProvider>
</QueryClientProvider>
</>
);
}
21 changes: 0 additions & 21 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,6 @@ class MyDocument extends Document {
return (
<Html lang='ko'>
<Head>
<Script strategy='afterInteractive' id='ms-clarity'>
{`
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", '${process.env.NEXT_PUBLIC_CLARITY_KEY}');
`}
</Script>
<Script
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GA_ID}`}
/>
<Script id='google-analytics' strategy='afterInteractive'>
{`
window.dataLayer = window.dataLayer || [];
function gtag(){window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.NEXT_PUBLIC_GA_ID}');
`}
</Script>
<link
rel='stylesheet'
href='https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.6/dist/web/variable/pretendardvariable-dynamic-subset.css'
Expand Down

0 comments on commit e275e8b

Please sign in to comment.