Add Google Analytics

Added Google Analytics to latest dev branch
This commit is contained in:
Charles Morgan 2020-07-26 21:05:54 -04:00
parent 4a27e56e08
commit cb4f8efbe6
No known key found for this signature in database
GPG key ID: D71946CD723249BD
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';
@ -60,6 +61,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/>