@@ -57,64 +57,11 @@ function appReady() {
5757 i18n . init ( function ( ) {
5858 startProcess ( ) ;
5959
60- checkSetupAnalytics ( function ( analyticsService ) {
61- analyticsService . sendEvent ( analyticsService . EVENT_CATEGORIES . APPLICATION , 'SelectedLanguage' , i18n . selectedLanguage ) ;
62- } ) ;
63-
6460 initializeSerialBackend ( ) ;
65- } ) ;
66- }
67-
68- function checkSetupAnalytics ( callback ) {
69- if ( ! analytics ) {
70- setTimeout ( function ( ) {
71- const result = ConfigStorage . get ( [ 'userId' , 'analyticsOptOut' , 'checkForConfiguratorUnstableVersions' ] ) ;
72- if ( ! analytics ) {
73- setupAnalytics ( result ) ;
74- }
75-
76- callback ( analytics ) ;
77- } ) ;
78- } else if ( callback ) {
79- callback ( analytics ) ;
80- }
81- }
82-
83- function getBuildType ( ) {
84- return GUI . Mode ;
85- }
86-
87- function setupAnalytics ( result ) {
88- let userId ;
89- if ( result . userId ) {
90- userId = result . userId ;
91- } else {
92- const uid = new ShortUniqueId ( ) ;
93- userId = uid . randomUUID ( 13 ) ;
94-
95- ConfigStorage . set ( { 'userId' : userId } ) ;
96- }
9761
98- const optOut = ! ! result . analyticsOptOut ;
99- const checkForDebugVersions = ! ! result . checkForConfiguratorUnstableVersions ;
100-
101- const debugMode = typeof process === "object" && process . versions [ 'nw-flavor' ] === 'sdk' ;
102-
103- window . analytics = new Analytics ( 'UA-123002063-1' , userId , CONFIGURATOR . productName , CONFIGURATOR . version , CONFIGURATOR . gitRevision , GUI . operating_system ,
104- checkForDebugVersions , optOut , debugMode , getBuildType ( ) ) ;
105-
106- function logException ( exception ) {
107- analytics . sendException ( exception . stack ) ;
108- }
109-
110- if ( typeof process === "object" ) {
111- process . on ( 'uncaughtException' , logException ) ;
112- }
113-
114- analytics . sendEvent ( analytics . EVENT_CATEGORIES . APPLICATION , 'AppStart' , { sessionControl : 'start' } ) ;
115-
116- $ ( '.connect_b a.connect' ) . removeClass ( 'disabled' ) ;
117- $ ( '.firmware_b a.flash' ) . removeClass ( 'disabled' ) ;
62+ $ ( '.connect_b a.connect' ) . removeClass ( 'disabled' ) ;
63+ $ ( '.firmware_b a.flash' ) . removeClass ( 'disabled' ) ;
64+ } ) ;
11865}
11966
12067function closeSerial ( ) {
@@ -177,8 +124,6 @@ function closeHandler() {
177124 this . hide ( ) ;
178125 }
179126
180- analytics . sendEvent ( analytics . EVENT_CATEGORIES . APPLICATION , 'AppClose' , { sessionControl : 'end' } ) ;
181-
182127 closeSerial ( ) ;
183128
184129 if ( ! GUI . isCordova ( ) ) {
@@ -313,10 +258,6 @@ function startProcess() {
313258 GUI . tab_switch_in_progress = false ;
314259 }
315260
316- checkSetupAnalytics ( function ( analyticsService ) {
317- analyticsService . sendAppView ( tab ) ;
318- } ) ;
319-
320261 switch ( tab ) {
321262 case 'landing' :
322263 import ( "./tabs/landing" ) . then ( ( { landing } ) =>
@@ -573,9 +514,6 @@ function startProcess() {
573514
574515 $ ( expertModeCheckbox ) . on ( "change" , ( ) => {
575516 const checked = $ ( expertModeCheckbox ) . is ( ':checked' ) ;
576- checkSetupAnalytics ( function ( analyticsService ) {
577- analyticsService . setDimension ( analyticsService . DIMENSIONS . CONFIGURATOR_EXPERT_MODE , checked ? 'On' : 'Off' ) ;
578- } ) ;
579517
580518 if ( FC . FEATURE_CONFIG && FC . FEATURE_CONFIG . features !== 0 ) {
581519 updateTabList ( FC . FEATURE_CONFIG . features ) ;
@@ -619,10 +557,6 @@ function startProcess() {
619557
620558function setDarkTheme ( enabled ) {
621559 DarkTheme . setConfig ( enabled ) ;
622-
623- checkSetupAnalytics ( function ( analyticsService ) {
624- analyticsService . sendEvent ( analyticsService . EVENT_CATEGORIES . APPLICATION , 'DarkTheme' , enabled ) ;
625- } ) ;
626560}
627561
628562
@@ -788,13 +722,10 @@ function showErrorDialog(message) {
788722
789723// TODO: all of these are used as globals in other parts.
790724// once moved to modules extract to own module.
791- window . googleAnalytics = analytics ;
792- window . analytics = null ;
793725window . showErrorDialog = showErrorDialog ;
794726window . generateFilename = generateFilename ;
795727window . updateTabList = updateTabList ;
796728window . isExpertModeEnabled = isExpertModeEnabled ;
797729window . checkForConfiguratorUpdates = checkForConfiguratorUpdates ;
798730window . setDarkTheme = setDarkTheme ;
799731window . appReady = appReady ;
800- window . checkSetupAnalytics = checkSetupAnalytics ;
0 commit comments