Skip to content

Commit

Permalink
feat: Matomo
Browse files Browse the repository at this point in the history
  • Loading branch information
Lnamw committed Aug 30, 2023
1 parent 1b403a5 commit 21fcc1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Mail/Views/Onboarding/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ final class LoginHandler: InfomaniakLoginDelegate, ObservableObject {

func loginAfterAccountCreation(from viewController: UIViewController) {
isLoading = true
matomo.track(eventWithCategory: .account, name: "openCreationWebview")
loginService.setupWebviewNavbar(
title: MailResourcesStrings.Localizable.buttonLogin,
titleColor: nil,
Expand Down Expand Up @@ -260,6 +259,7 @@ struct OnboardingView: View {
navigationState.transitionToRootViewDestination(.noMailboxes)
}
}
.matomoView(view: [MatomoUtils.View.onboarding.displayName, "Main"])
}

// MARK: - Private methods
Expand Down
5 changes: 5 additions & 0 deletions Mail/Views/Switch User/CreateAccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import InfomaniakCoreUI
import InfomaniakCreateAccount
import InfomaniakDI
import InfomaniakLogin
import MailCore
import MailResources
Expand Down Expand Up @@ -68,6 +70,8 @@ struct CreateAccountView: View {
Spacer()

MailButton(label: MailResourcesStrings.Localizable.buttonStart) {
@InjectService var matomo: MatomoUtils
matomo.track(eventWithCategory: .account, name: "openCreationWebview")
isPresentingCreateAccount.toggle()
}
.mailButtonFullWidth(true)
Expand All @@ -80,6 +84,7 @@ struct CreateAccountView: View {
loginHandler.loginAfterAccountCreation(from: viewController)
}
}
.matomoView(view: [MatomoUtils.View.onboarding.displayName, "CreateAccount"])
}
}

Expand Down
1 change: 1 addition & 0 deletions MailCore/Utils/Matomo+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import SwiftUI
public extension MatomoUtils.View {
static let accountView = MatomoUtils.View(displayName: "AccountView")
static let bottomSheet = MatomoUtils.View(displayName: "BottomSheet")
static let onboarding = MatomoUtils.View(displayName: "Onboarding")
static let threadListView = MatomoUtils.View(displayName: "ThreadListView")
static let threadView = MatomoUtils.View(displayName: "ThreadView")
static let settingsView = MatomoUtils.View(displayName: "SettingsView")
Expand Down

0 comments on commit 21fcc1a

Please sign in to comment.