Skip to content

Commit 2c74817

Browse files
committed
fix analitycs
1 parent fe549c1 commit 2c74817

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pages/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import Comparison from "../components/Comparison";
1616
function HomepageHeader() {
1717
const {siteConfig} = useDocusaurusContext();
1818

19-
ReactGA.initialize('G-MNT2DFSGCM');
20-
ReactGA.pageview(window.location.pathname + window.location.search);
21-
2219
return (
2320
<header className={clsx('hero hero--primary', styles.heroBanner)}>
2421
<img src={helmsman} className={styles.image}/>
@@ -49,6 +46,12 @@ export default function Home() {
4946
<Layout
5047
title={`Developer firendly Kubernetes`}
5148
description="Description will go into a meta tag in <head />">
49+
<BrowserOnly fallback={<div>Loading...</div>}>
50+
{() => {
51+
ReactGA.initialize('G-MNT2DFSGCM');
52+
ReactGA.pageview(window.location.pathname + window.location.search);
53+
}}
54+
</BrowserOnly>
5255
<HomepageHeader/>
5356
<main>
5457
<HomepageFeatures/>

0 commit comments

Comments
 (0)