Skip to content

Commit

Permalink
setup google analytics
Browse files Browse the repository at this point in the history
relates #111
  • Loading branch information
rehabas committed Jun 3, 2020
1 parent 4241afa commit 7e40307
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/src/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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');
Expand Down

0 comments on commit 7e40307

Please sign in to comment.