import { GoogleAnalytics } from 'ionic-native' ; import { ANALYTICS_UA , DEBUG_MODE } from '../const' ; class export class Analytics { static returns { Promise < void > } public static configure ( ) { return GoogleAnalytics . startTrackerWithId ( ANALYTICS_UA ) . then ( ( ) => GoogleAnalytics . enableUncaughtExceptionReporting ( true ) , console . error ) . then ( ( ) => { if ( DEBUG_MODE ) GoogleAnalytics . debugMode ( ) ; } , console . error ) ; } param { string } title param { string } campaignUrl static returns { Promise < void > } public static trackView ( title , campaignUrl ? ) { return GoogleAnalytics . trackView ( title , campaignUrl ) . then ( console . log , console . error ) ; } param { string } category param { string } action param { string } label param { number } value static returns { Promise < void > } public static trackEvent ( category , action , label ? , value ? ) { return GoogleAnalytics . trackEvent ( category , action , label , value ) . then ( console . log , console . error ) ; } param { string } id static returns { void } public static setUserId ( id ) { GoogleAnalytics . setUserId ( id ) ; } }