Merge pull request #2191 from Sir3lit/googleanalytics2

Add Google Analytics Support
This commit is contained in:
Dane Everitt 2020-08-01 16:55:06 -07:00 committed by GitHub
commit 0d089acf3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 81 additions and 38 deletions

View file

@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import ReactGA from 'react-ga';
import { NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom';
import NavigationBar from '@/components/NavigationBar';
import ServerConsole from '@/components/server/ServerConsole';
@ -61,6 +62,10 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>)
};
}, [ match.params.id ]);
useEffect(() => {
ReactGA.pageview(location.pathname);
}, [ location.pathname ]);
return (
<React.Fragment key={'server-router'}>
<NavigationBar/>