This commit is contained in:
mjrode
2019-04-14 17:46:00 -05:00
parent 0eb7f9f9a4
commit 950f38eefc

View File

@@ -3,6 +3,7 @@ import {BrowserRouter, Route} from 'react-router-dom';
import {connect} from 'react-redux';
import * as actions from '../actions';
import ReactGA from 'react-ga';
import createHistory from 'history/createBrowserHistory';
import Header from './Header';
import Hero from './Hero';
@@ -12,11 +13,14 @@ import SimilarList from './SimilarList';
import PopularList from './PopularList';
import PlexTokenForm from './plex/PlexTokenForm';
const history = createHistory();
ReactGA.initialize('UA-138294820-1');
history.listen((location, action) => {
ReactGA.pageview(location.pathname + location.search);
console.log(location.pathname);
});
class App extends Component {
componentDidMount() {
ReactGA.pageview(window.location.pathname + window.location.search);
this.props.fetchUser();
}