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 * as React from 'react';
import React, { useEffect } from 'react';
import ReactGA from 'react-ga';
import { hot } from 'react-hot-loader/root';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { StoreProvider } from 'easy-peasy';
@ -48,6 +49,11 @@ const App = () => {
store.getActions().settings.setSettings(SiteConfiguration!);
}
useEffect(() => {
ReactGA.initialize(SiteConfiguration!.analytics);
ReactGA.pageview(location.pathname);
}, []);
return (
<>
<GlobalStylesheet/>