Skip to content

Commit 410d685

Browse files
committed
Track tap on Connect Jetpack button and error fetching connection URL and Jetpack user
1 parent 9ce7d81 commit 410d685

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

WooCommerce/Classes/Authentication/Navigation Exceptions/JetpackConnectionErrorViewModel.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ final class JetpackConnectionErrorViewModel: ULErrorViewModel {
5858
}
5959

6060
func didTapPrimaryButton(in viewController: UIViewController?) {
61+
analytics.track(.loginJetpackConnectButtonTapped)
6162
showJetpackConnectionWebView(from: viewController)
6263
}
6364

@@ -111,6 +112,7 @@ private extension JetpackConnectionErrorViewModel {
111112
case .success(let url):
112113
self.jetpackConnectionURL = url
113114
case .failure(let error):
115+
self.analytics.track(.loginJetpackConnectionURLFetchFailed, withError: error)
114116
DDLogWarn("⚠️ Error fetching Jetpack connection URL: \(error)")
115117
}
116118
}
@@ -130,11 +132,13 @@ private extension JetpackConnectionErrorViewModel {
130132
case .success(let user):
131133
guard let emailAddress = user.wpcomUser?.email else {
132134
DDLogWarn("⚠️ Cannot find connected WPcom user")
135+
self.analytics.track(.loginJetpackConnectionVerificationFailed)
133136
return self.showSetupErrorNotice(in: viewController)
134137
}
135138
self.jetpackSetupCompletionHandler(emailAddress)
136139
case .failure(let error):
137140
DDLogWarn("⚠️ Error fetching Jetpack user: \(error)")
141+
self.analytics.track(.loginJetpackConnectionVerificationFailed, withError: error)
138142
self.showSetupErrorNotice(in: viewController)
139143
}
140144
}

0 commit comments

Comments
 (0)