import ReactGA from 'react-ga'

const isProduction = process.env.NODE_ENV === 'production'

export const initGA = () => {
  ReactGA.initialize('UA-108480205-1')
}

export const logPageView = () => {
  if (!isProduction) return
  const page = window.location.pathname
  ReactGA.set({ page })
  ReactGA.pageview(page)
}

export const logEvent = (category = '', action = '') => {
  if (!isProduction) return
  if (category && action) {
    ReactGA.event({ category, action })
  }
}

export const logException = (description = '', fatal = false) => {
  if (!isProduction) return
  if (description) {
    ReactGA.exception({ description, fatal })
  }
}

@@ -29,29 +29,71 @@
 a'%0A%0A
-const isProduction = 
+let isInitialized = false%0A%0Aexport const initGA = () =%3E %7B%0A  if (
 proc
@@ -129,40 +129,14 @@
 ion'
-%0A%0Aexport const initGA = () =%3E %7B%0A
+) %7B%0A  
   Re
@@ -170,16 +170,45 @@
 205-1')%0A
+    isInitialized = true%0A  %7D%0A
 %7D%0A%0Aexpor
@@ -242,34 +242,35 @@
  %7B%0A  if (!is
-Production
+Initialized
 ) return%0A  c
@@ -421,34 +421,35 @@
  %7B%0A  if (!is
-Production
+Initialized
 ) return%0A  i
@@ -600,18 +600,19 @@
 (!is
-Production
+Initialized
 ) re

Modify ga