import ReactGA , { FieldsObject } from 'react-ga' ; const host = window . location . hostname ; let initializeGA = ( ) => { } ; let trackPage = ( page , options ) => { } ; let trackEvent = ( category , action , label = '' ) => { } ; if ( host !== 'localhost' ) { initializeGA = ( ) => ReactGA . initialize ( 'UA-50311880-5' ) ; trackPage = ( page , options ) => { ReactGA . set ( { page , ... options } ) ; ReactGA . pageview ( page ) ; } ; trackEvent = ( category , action , label = '' ) => { ReactGA . event ( { action , category : `${ action } ${ label }` , } ) ; } ; } export { initializeGA , trackPage , trackEvent } ;