We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 785141f commit 361eeffCopy full SHA for 361eeff
src/app/pages/index.js
@@ -103,12 +103,14 @@ class Routes extends React.PureComponent<Props> {
103
<Route
104
path="/"
105
render={({ location }) => {
106
- routeDebugger(
107
- `Sending '${location.pathname + location.search}' to ga.`
108
- );
109
- if (typeof window.ga === 'function') {
110
- window.ga('set', 'page', location.pathname + location.search);
111
- window.ga('send', 'pageview');
+ if (process.env.NODE_ENV === 'production') {
+ routeDebugger(
+ `Sending '${location.pathname + location.search}' to ga.`
+ );
+ if (typeof window.ga === 'function') {
+ window.ga('set', 'page', location.pathname + location.search);
112
+ window.ga('send', 'pageview');
113
+ }
114
}
115
return null;
116
}}
0 commit comments