@@ -77,7 +77,12 @@ public static void migrateAppWideMobileEditorPreferenceToRemote(final AccountSto
77
77
}
78
78
}
79
79
80
- // Enable Gutenberg for all sites using a single network call
80
+ // Track and enable Gutenberg for all sites using a single network call. Ideally we would track this
81
+ // on the network response, but this would make this rollout even more complex.
82
+ // There might be some rare events when we register a site switched to Gutenberg which is actually
83
+ // still on Aztec.
84
+ trackGutenbergEnabledForNonGutenbergSites (siteStore ,
85
+ BlockEditorEnabledSource .ON_PROGRESSIVE_ROLLOUT_PHASE_2 );
81
86
dispatcher .dispatch (SiteActionBuilder .newDesignateMobileEditorForAllSitesAction (
82
87
new DesignateMobileEditorForAllSitesPayload (SiteUtils .GB_EDITOR_NAME , false )));
83
88
@@ -114,7 +119,12 @@ public static void migrateAppWideMobileEditorPreferenceToRemote(final AccountSto
114
119
}
115
120
}
116
121
117
- // Enable Gutenberg for all sites using a single network call
122
+ // Track and enable and Gutenberg for all sites using a single network call. Ideally we would track this
123
+ // on the network response, but this would make this rollout even more complex.
124
+ // There might be some rare events when we register a site switched to Gutenberg which is actually
125
+ // still on Aztec.
126
+ trackGutenbergEnabledForNonGutenbergSites (siteStore ,
127
+ BlockEditorEnabledSource .ON_PROGRESSIVE_ROLLOUT_PHASE_1 );
118
128
dispatcher .dispatch (SiteActionBuilder .newDesignateMobileEditorForAllSitesAction (
119
129
new DesignateMobileEditorForAllSitesPayload (SiteUtils .GB_EDITOR_NAME )));
120
130
@@ -136,6 +146,15 @@ public static void migrateAppWideMobileEditorPreferenceToRemote(final AccountSto
136
146
}
137
147
}
138
148
149
+ private static void trackGutenbergEnabledForNonGutenbergSites (final SiteStore siteStore ,
150
+ final BlockEditorEnabledSource source ) {
151
+ for (SiteModel site : siteStore .getSites ()) {
152
+ if (!TextUtils .equals (site .getMobileEditor (), GB_EDITOR_NAME )) {
153
+ AnalyticsUtils .trackWithSiteDetails (Stat .EDITOR_GUTENBERG_ENABLED , site , source .asPropertyMap ());
154
+ }
155
+ }
156
+ }
157
+
139
158
private static boolean atLeastOneSiteHasAztecEnabled (final SiteStore siteStore ) {
140
159
// We want to make sure to enable Gutenberg only on the sites they didn't opt-out.
141
160
for (SiteModel site : siteStore .getSites ()) {
0 commit comments