From 7e40307fee070d6adf5e42698ea0a19594beefaf Mon Sep 17 00:00:00 2001 From: rehabas Date: Wed, 3 Jun 2020 17:55:56 +0300 Subject: [PATCH] setup google analytics relates #111 --- client/src/app/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/app/index.js b/client/src/app/index.js index fb0420dd..c0377f9f 100644 --- a/client/src/app/index.js +++ b/client/src/app/index.js @@ -6,6 +6,7 @@ import { Redirect, } from 'react-router-dom'; import axios from 'axios'; +import ReactGa from 'react-ga'; import * as ROUTES from '../constants/routes'; import LogoutContext from '../Contexts/LogoutContext'; @@ -26,6 +27,11 @@ class App extends Component { async componentDidMount() { try { + const { + location: { pathname, search }, + } = window; + ReactGa.initialize('UA-168097204-1'); + ReactGa.pageview(pathname + search); const { data: { statusCode }, } = await axios.get('/api/v1/is-auth');