Skip to content

Commit 870511b

Browse files
authored
Merge pull request #10321 from wordpress-mobile/login/fix-login-tracks
Pull in login changes from woo-android
2 parents 793d2b8 + 190f26a commit 870511b

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

libs/login/WordPressLoginFlow/src/main/java/org/wordpress/android/login/LoginSiteAddressFragment.java

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,24 @@ public void onFetchedConnectSiteInfo(OnConnectSiteInfoChecked event) {
412412
// TODO: If we plan to keep this logic we should convert these labels to constants
413413
HashMap<String, String> properties = new HashMap<>();
414414
properties.put("url", event.info.url);
415-
properties.put("urlAfterRedirects", event.info.urlAfterRedirects);
415+
properties.put("url_after_redirects", event.info.urlAfterRedirects);
416416
properties.put("exists", Boolean.toString(event.info.exists));
417-
properties.put("hasJetpack", Boolean.toString(event.info.hasJetpack));
418-
properties.put("isJetpackActive", Boolean.toString(event.info.isJetpackActive));
419-
properties.put("isJetpackConnected", Boolean.toString(event.info.isJetpackConnected));
420-
properties.put("isWordPress", Boolean.toString(event.info.isWordPress));
421-
properties.put("isWPCom", Boolean.toString(event.info.isWPCom));
417+
properties.put("has_jetpack", Boolean.toString(event.info.hasJetpack));
418+
properties.put("is_jetpack_active", Boolean.toString(event.info.isJetpackActive));
419+
properties.put("is_jetpack_connected", Boolean.toString(event.info.isJetpackConnected));
420+
properties.put("is_wordpress", Boolean.toString(event.info.isWordPress));
421+
properties.put("is_wp_com", Boolean.toString(event.info.isWPCom));
422+
423+
// Determining if jetpack is actually installed takes additional logic. This final
424+
// calculated event property will make querying this event more straight-forward:
425+
boolean hasJetpack = false;
426+
if (event.info.isWPCom && event.info.hasJetpack) {
427+
// This is likely an atomic site.
428+
hasJetpack = true;
429+
} else if (event.info.hasJetpack && event.info.isJetpackActive && event.info.isJetpackConnected) {
430+
hasJetpack = true;
431+
}
432+
properties.put("login_calculated_has_jetpack", Boolean.toString(hasJetpack));
422433
mAnalyticsListener.trackConnectedSiteInfoSucceeded(properties);
423434

424435
if (!event.info.exists) {
@@ -428,13 +439,6 @@ public void onFetchedConnectSiteInfo(OnConnectSiteInfoChecked event) {
428439
// Not a WordPress site
429440
showError(R.string.enter_wordpress_site);
430441
} else {
431-
boolean hasJetpack = false;
432-
if (event.info.isWPCom && event.info.hasJetpack) {
433-
// This is likely an atomic site.
434-
hasJetpack = true;
435-
} else if (event.info.hasJetpack && event.info.isJetpackActive && event.info.isJetpackConnected) {
436-
hasJetpack = true;
437-
}
438442
mLoginListener.gotConnectedSiteInfo(
439443
event.info.url,
440444
event.info.urlAfterRedirects,

0 commit comments

Comments
 (0)