Analytics (#582)

* gtm > ga

* Record pageviews in SPA

* Remove home-rolled tracking in favor of autotrack

* cleanup
This commit is contained in:
Tom Moor
2018-02-10 23:23:50 -08:00
committed by GitHub
parent bd84a73b20
commit 4cc7338534
8 changed files with 148 additions and 28 deletions

View File

@@ -0,0 +1,18 @@
// @flow
// based on: https://reacttraining.com/react-router/web/guides/scroll-restoration
import { Component } from 'react';
import { withRouter } from 'react-router-dom';
class ScrollToTop extends Component {
componentDidUpdate(prevProps) {
if (this.props.location !== prevProps.location) {
window.scrollTo(0, 0);
}
}
render() {
return this.props.children;
}
}
export default withRouter(ScrollToTop);