Merge pull request #2833 from AlphaWallet/log-first-wallet-action-for-installs

Log what is the first action (create, import, watch wallet) for new installs
pull/2843/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit 799d8e33ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      AlphaWallet/Analytics/Models/AnalyticsTypes.swift
  2. 4
      AlphaWallet/AppCoordinator.swift
  3. 11
      AlphaWallet/Wallet/Coordinators/WalletCoordinator.swift

@ -55,6 +55,7 @@ enum Analytics {
case clearBrowserCache = "Clear Browser Cache"
case rectifySendTransactionErrorInActionSheet = "Rectify Send Txn Error"
case nameWallet = "Name Wallet"
case firstWalletAction = "First Wallet Action"
}
enum Properties: String {
@ -149,4 +150,10 @@ enum Analytics {
case token
case wallet
}
enum FirstWalletAction: String {
case create
case `import`
case watch
}
}

@ -54,7 +54,7 @@ class AppCoordinator: NSObject, Coordinator {
analyticsCoordinator: analyticsService,
viewModel: .init(configuration: .summary)
)
coordinator.delegate = self
coordinator.delegate = self
return coordinator
}()
@ -451,7 +451,7 @@ extension AppCoordinator: UrlSchemeCoordinatorDelegate {
}
extension AppCoordinator: AccountsCoordinatorDelegate {
func didAddAccount(account: Wallet, in coordinator: AccountsCoordinator) {
coordinator.navigationController.dismiss(animated: true)
}

@ -200,14 +200,17 @@ extension WalletCoordinator: QRCodeResolutionCoordinatorDelegate {
extension WalletCoordinator: CreateInitialWalletViewControllerDelegate {
func didTapCreateWallet(inViewController viewController: CreateInitialWalletViewController) {
logInitialAction(.create)
createInstantWallet()
}
func didTapWatchWallet(inViewController viewController: CreateInitialWalletViewController) {
logInitialAction(.watch)
addWalletWith(entryPoint: .watchWallet(address: nil))
}
func didTapImportWallet(inViewController viewController: CreateInitialWalletViewController) {
logInitialAction(.import)
addWalletWith(entryPoint: .importWallet)
}
}
@ -216,7 +219,6 @@ extension WalletCoordinator: WalletCoordinatorDelegate {
func didFinish(with account: Wallet, in coordinator: WalletCoordinator) {
coordinator.navigationController.dismiss(animated: false)
removeCoordinator(coordinator)
delegate?.didFinish(with: account, in: self)
}
@ -226,3 +228,10 @@ extension WalletCoordinator: WalletCoordinatorDelegate {
removeCoordinator(coordinator)
}
}
// MARK: Analytics
extension WalletCoordinator {
private func logInitialAction(_ action: Analytics.FirstWalletAction) {
analyticsCoordinator.log(action: Analytics.Action.firstWalletAction, properties: [Analytics.Properties.type.rawValue: action.rawValue])
}
}
Loading…
Cancel
Save