Skip to content

Commit f95c19f

Browse files
committed
disable fetching js on server side
1 parent d78dfd2 commit f95c19f

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

frontend/src/pages/_app.tsx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,31 @@ function App({ Component, pageProps }: AppProps) {
88
return (
99
<>
1010
<Head>
11-
<script
12-
async
13-
src="https://www.googletagmanager.com/gtag/js?id=UA-116967778-8"
14-
></script>
15-
<script
16-
dangerouslySetInnerHTML={{
17-
__html: `window.dataLayer = window.dataLayer || [];
11+
{process.browser && (
12+
// google analytics
13+
<>
14+
<script
15+
async
16+
src="https://www.googletagmanager.com/gtag/js?id=UA-116967778-8"
17+
></script>
18+
<script
19+
dangerouslySetInnerHTML={{
20+
__html: `window.dataLayer = window.dataLayer || [];
1821
function gtag(){dataLayer.push(arguments);}
1922
gtag('js', new Date());
2023
gtag('config', 'UA-116967778-8');`,
21-
}}
22-
></script>
23-
{/* adsens */}
24-
<script
25-
data-ad-client="ca-pub-7134126650568891"
26-
async
27-
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
28-
></script>
29-
{/* adsense end */}
24+
}}
25+
></script>
26+
</>
27+
)}
28+
{process.browser && (
29+
// adsense
30+
<script
31+
data-ad-client="ca-pub-7134126650568891"
32+
async
33+
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
34+
></script>
35+
)}
3036
<link rel="icon" href="/favicon.ico" />
3137
<meta name="viewport" content="width=device-width, initial-scale=1" />
3238
<meta name="description" content="Generate pairwise testcases online" />

0 commit comments

Comments
 (0)