File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Authentication/Navigation Exceptions Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1591,3 +1591,17 @@ extension WooAnalyticsEvent {
15911591 WooAnalyticsEvent ( statName: . universalLinkFailed, properties: [ Key . url. rawValue: url. absoluteString] )
15921592 }
15931593}
1594+
1595+ // MARK: - Jetpack connection
1596+ //
1597+ extension WooAnalyticsEvent {
1598+ enum LoginJetpackConnection {
1599+ enum Key : String {
1600+ case selfHosted = " is_selfhosted_site "
1601+ }
1602+
1603+ static func jetpackConnectionErrorShown( selfHostedSite: Bool ) -> WooAnalyticsEvent {
1604+ WooAnalyticsEvent ( statName: . loginJetpackConnectionErrorShown, properties: [ Key . selfHosted. rawValue: selfHostedSite] )
1605+ }
1606+ }
1607+ }
Original file line number Diff line number Diff line change @@ -8,15 +8,18 @@ final class JetpackConnectionErrorViewModel: ULErrorViewModel {
88 private let siteURL : String
99 private var jetpackConnectionURL : URL ?
1010 private let stores : StoresManager
11+ private let analytics : Analytics
1112 private let isPrimaryButtonLoadingSubject = CurrentValueSubject < Bool , Never > ( false )
1213 private let jetpackSetupCompletionHandler : ( String ) -> Void
1314
1415 init ( siteURL: String ,
1516 credentials: WordPressOrgCredentials ,
1617 stores: StoresManager = ServiceLocator . stores,
18+ analytics: Analytics = ServiceLocator . analytics,
1719 onJetpackSetupCompletion: @escaping ( String ) -> Void ) {
1820 self . siteURL = siteURL
1921 self . stores = stores
22+ self . analytics = analytics
2023 self . jetpackSetupCompletionHandler = onJetpackSetupCompletion
2124 authenticate ( with: credentials)
2225 fetchJetpackConnectionURL ( )
@@ -51,7 +54,7 @@ final class JetpackConnectionErrorViewModel: ULErrorViewModel {
5154 let secondaryButtonTitle = Localization . secondaryButtonTitle
5255
5356 func viewDidLoad( _ viewController: UIViewController ? ) {
54- // TODO: Tracks?
57+ analytics . track ( event : . LoginJetpackConnection . jetpackConnectionErrorShown ( selfHostedSite : true ) )
5558 }
5659
5760 func didTapPrimaryButton( in viewController: UIViewController ? ) {
You can’t perform that action at this time.
0 commit comments