moved google analytics initialization inside if statement

This commit is contained in:
bill bittner 2018-06-07 10:05:34 -07:00
parent bf771998a8
commit 5484e39eaa
2 changed files with 3 additions and 4 deletions

View file

@ -41,9 +41,9 @@ if (!_siteConfig.default) {
if (_siteConfig.default.analytics) {
googleId = _siteConfig.default.analytics.googleId;
}
_reactGa.default.initialize(googleId);
_reactGa.default.initialize(googleId);
}
var GAListener =
/*#__PURE__*/

View file

@ -12,10 +12,9 @@ if (!siteConfig) {
if (siteConfig.analytics) {
({ googleId } = siteConfig.analytics);
GoogleAnalytics.initialize(googleId);
}
GoogleAnalytics.initialize(googleId);
class GAListener extends React.Component {
componentDidMount () {
this.sendPageView(this.props.history.location);