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 e91713c commit 18186fbCopy full SHA for 18186fb
src/lib/analytics.js
@@ -8,6 +8,13 @@ if (GA_ID) {
8
sampleRate: (process.env.NODE_ENV === 'production') ? 100 : 0,
9
forceSSL: true
10
});
11
+} else {
12
+ window.ga = () => {
13
+ // The `react-ga` module calls this function to implement all Google Analytics calls. Providing an empty
14
+ // function effectively disables `react-ga`. This is similar to the `testModeAPI` feature of `react-ga` except
15
+ // that `testModeAPI` logs the arguments of every call into an array. That's nice for testing purposes but
16
+ // would look like a memory leak in a live program.
17
+ };
18
}
19
20
export default GoogleAnalytics;
0 commit comments