Skip to content

Commit 2e1c1b0

Browse files
author
Christopher Willis-Ford
committed
log a message if we skip GA init
1 parent 18186fb commit 2e1c1b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/analytics.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import GoogleAnalytics from 'react-ga';
22

3+
import log from './log';
4+
35
const GA_ID = (process.env.GA_ID || window.GA_ID);
46
if (GA_ID) {
57
GoogleAnalytics.initialize(GA_ID, {
@@ -9,6 +11,7 @@ if (GA_ID) {
911
forceSSL: true
1012
});
1113
} else {
14+
log.info('Disabling GA because GA_ID is not set.');
1215
window.ga = () => {
1316
// The `react-ga` module calls this function to implement all Google Analytics calls. Providing an empty
1417
// function effectively disables `react-ga`. This is similar to the `testModeAPI` feature of `react-ga` except

0 commit comments

Comments
 (0)