moved google analytics initialization inside if statement
This commit is contained in:
parent
bf771998a8
commit
5484e39eaa
2 changed files with 3 additions and 4 deletions
|
@ -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__*/
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue