mirror of
https://github.com/mjrode/WhatToWatch.git
synced 2025-12-30 18:19:46 -06:00
Add GA
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user