Adding Google Analytics
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import ReactGA from 'react-ga';
|
||||
|
||||
const setupGA = () => {
|
||||
ReactGA.initialize(process.env.GA_PROPERTY, {
|
||||
debug: (process.env.NODE_ENV !== 'production')
|
||||
});
|
||||
ReactGA.pageview(document.location.pathname);
|
||||
};
|
||||
|
||||
export { setupGA };
|
||||
@@ -1 +1,4 @@
|
||||
import '../../style.css';
|
||||
import { setupGA } from '../../analytics';
|
||||
|
||||
setupGA();
|
||||
|
||||
@@ -5,5 +5,8 @@ import App from '../../components/App';
|
||||
|
||||
import '../../style.css';
|
||||
import '../../service-worker';
|
||||
import { setupGA } from '../../analytics';
|
||||
|
||||
setupGA();
|
||||
|
||||
ReactDOM.render(<App/>, document.getElementById('root'));
|
||||
|
||||
Reference in New Issue
Block a user