@@ -20,6 +20,7 @@ import '../extensions/extension_service.dart';
20
20
import '../screens/debugger/breakpoint_manager.dart' ;
21
21
import '../service/service_manager.dart' ;
22
22
import '../service/vm_service_wrapper.dart' ;
23
+ import '../shared/analytics/analytics.dart' as ga;
23
24
import '../shared/config_specific/framework_initialize/framework_initialize.dart' ;
24
25
import '../shared/console/eval/eval_service.dart' ;
25
26
import '../shared/feature_flags.dart' ;
@@ -56,6 +57,17 @@ abstract class FrameworkCore {
56
57
57
58
await initializePlatform ();
58
59
60
+ // Initialize analytics metrics before initializing the rest of the
61
+ // framework. It is important that this method call is here, after the
62
+ // `storage` global variable has been set by the `initializePlatform` call,
63
+ // since the analytics dimensions reference the `storage` global. We
64
+ // initialize this now so that any analytics events sent from here on our
65
+ // include the expected metadata.
66
+ // TODO(kenz): consider making the dimensions that need initialization
67
+ // `late` so that they can be initialized on first access rather than
68
+ // manually.
69
+ await ga.setupDimensions ();
70
+
59
71
// Print DevTools info at startup.
60
72
_log.info (
61
73
'Version: $devToolsVersion , Renderer: ${kIsWasm ? 'skwasm' : 'canvaskit' }' ,
0 commit comments