From 4d717957111f2e2cc3905b02c38d82688870e1ae Mon Sep 17 00:00:00 2001 From: flaviuvsp Date: Mon, 27 Nov 2023 15:09:20 +0200 Subject: [PATCH] Add new events tracking --- Permanent.xcodeproj/project.pbxproj | 42 ++++++++++++------- Permanent/App/AppDelegate.swift | 2 +- .../Common/Helpers/Events/EventPage.swift | 15 +++++++ .../Common/Helpers/Events/EventType.swift | 17 ++++++++ .../Helpers/Events/EventsManager.swift | 9 +++- Permanent/Helpers/Events/EventType.swift | 12 ------ .../BiometricsViewController.swift | 1 + .../CodeVerificationController.swift | 2 +- .../ViewController/MainViewController.swift | 7 +++- .../PublicArchiveViewController.swift | 1 + .../PublicProfilePageViewModel.swift | 4 ++ .../RightSideMenuViewController.swift | 5 +++ .../SideMenuViewController.swift | 6 +++ .../Storage/DonateViewController.swift | 4 +- 14 files changed, 93 insertions(+), 34 deletions(-) create mode 100644 Permanent/Common/Helpers/Events/EventPage.swift create mode 100644 Permanent/Common/Helpers/Events/EventType.swift rename Permanent/{ => Common}/Helpers/Events/EventsManager.swift (73%) delete mode 100644 Permanent/Helpers/Events/EventType.swift diff --git a/Permanent.xcodeproj/project.pbxproj b/Permanent.xcodeproj/project.pbxproj index ac8bfc18..d5e9531f 100644 --- a/Permanent.xcodeproj/project.pbxproj +++ b/Permanent.xcodeproj/project.pbxproj @@ -75,8 +75,6 @@ 5E1CCC27287F055F00913EEA /* UIImageExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCE3C96325388C8D00EC3A66 /* UIImageExtension.swift */; }; 5E1CCC28287F056C00913EEA /* UIButtonExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC6D3B4425138DFF00390927 /* UIButtonExtension.swift */; }; 5E1CCC29287F133000913EEA /* ActionDialogView.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCC1E32B254A193C00B71866 /* ActionDialogView.xib */; }; - 5E1CE4412AAF32BE00EEE52E /* EventsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E1CE43F2AAF32BD00EEE52E /* EventsManager.swift */; }; - 5E1CE4422AAF32BE00EEE52E /* EventType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E1CE4402AAF32BD00EEE52E /* EventType.swift */; }; 5E1DE53C27E1245000FBD7FA /* UpdateNecessaryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E1DE53B27E1245000FBD7FA /* UpdateNecessaryViewController.swift */; }; 5E1E4FA92988897F0062984C /* ManageTagsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E1E4FA82988897F0062984C /* ManageTagsTests.swift */; }; 5E202E062981FD660063DDED /* ArchiveSettingsTagCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E202E042981FD660063DDED /* ArchiveSettingsTagCollectionViewCell.swift */; }; @@ -406,6 +404,12 @@ 92430A5D2AF2A1F00098597D /* EmailChip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A5A2AF2A1F00098597D /* EmailChip.swift */; }; 92430A5E2AF2A1F00098597D /* EmailChipsTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A5B2AF2A1F00098597D /* EmailChipsTextField.swift */; }; 92430A5F2AF2A1F00098597D /* EmailChipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A5C2AF2A1F00098597D /* EmailChipView.swift */; }; + 92430A902B10A55E0098597D /* EventType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A8E2B10A55E0098597D /* EventType.swift */; }; + 92430A912B10A55E0098597D /* EventsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A8F2B10A55E0098597D /* EventsManager.swift */; }; + 92430A932B10A5690098597D /* EventPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A922B10A5690098597D /* EventPage.swift */; }; + 92430A942B10D5680098597D /* EventType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A8E2B10A55E0098597D /* EventType.swift */; }; + 92430A952B10D56B0098597D /* EventsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A8F2B10A55E0098597D /* EventsManager.swift */; }; + 92430A962B10D56E0098597D /* EventPage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92430A922B10A5690098597D /* EventPage.swift */; }; 924E839C2A165D28005D813B /* ButtonWithRightImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 924E839B2A165D28005D813B /* ButtonWithRightImage.swift */; }; 924F162F2A45954A00B75D4E /* TagsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 924F162E2A45954A00B75D4E /* TagsView.swift */; }; 924F16312A459C2E00B75D4E /* FlowGrid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 924F16302A459C2E00B75D4E /* FlowGrid.swift */; }; @@ -927,8 +931,6 @@ 5E1C546029B8CA0C00A04B99 /* FileCollectionViewHeaderCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FileCollectionViewHeaderCell.xib; sourceTree = ""; }; 5E1CCC17287EE4B800913EEA /* ShareExtensionNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShareExtensionNavigationController.swift; sourceTree = ""; }; 5E1CCC18287EE4B800913EEA /* ShareExtensionViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShareExtensionViewModel.swift; sourceTree = ""; }; - 5E1CE43F2AAF32BD00EEE52E /* EventsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EventsManager.swift; path = Permanent/Helpers/Events/EventsManager.swift; sourceTree = SOURCE_ROOT; }; - 5E1CE4402AAF32BD00EEE52E /* EventType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EventType.swift; path = Permanent/Helpers/Events/EventType.swift; sourceTree = SOURCE_ROOT; }; 5E1DE53B27E1245000FBD7FA /* UpdateNecessaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateNecessaryViewController.swift; sourceTree = ""; }; 5E1E4FA82988897F0062984C /* ManageTagsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ManageTagsTests.swift; sourceTree = ""; }; 5E202E042981FD660063DDED /* ArchiveSettingsTagCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveSettingsTagCollectionViewCell.swift; sourceTree = ""; }; @@ -1180,6 +1182,9 @@ 92430A5A2AF2A1F00098597D /* EmailChip.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailChip.swift; sourceTree = ""; }; 92430A5B2AF2A1F00098597D /* EmailChipsTextField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailChipsTextField.swift; sourceTree = ""; }; 92430A5C2AF2A1F00098597D /* EmailChipView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailChipView.swift; sourceTree = ""; }; + 92430A8E2B10A55E0098597D /* EventType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventType.swift; sourceTree = ""; }; + 92430A8F2B10A55E0098597D /* EventsManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventsManager.swift; sourceTree = ""; }; + 92430A922B10A5690098597D /* EventPage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventPage.swift; sourceTree = ""; }; 924E839B2A165D28005D813B /* ButtonWithRightImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonWithRightImage.swift; sourceTree = ""; }; 924F162E2A45954A00B75D4E /* TagsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TagsView.swift; sourceTree = ""; }; 924F16302A459C2E00B75D4E /* FlowGrid.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlowGrid.swift; sourceTree = ""; }; @@ -1743,15 +1748,6 @@ path = Local; sourceTree = ""; }; - 5E1CE43E2AAF32A600EEE52E /* Events */ = { - isa = PBXGroup; - children = ( - 5E1CE43F2AAF32BD00EEE52E /* EventsManager.swift */, - 5E1CE4402AAF32BD00EEE52E /* EventType.swift */, - ); - path = Events; - sourceTree = ""; - }; 5E202E032981FCEF0063DDED /* ArchiveSettings */ = { isa = PBXGroup; children = ( @@ -2891,6 +2887,16 @@ path = ChipView; sourceTree = ""; }; + 92430A8D2B10A55E0098597D /* Events */ = { + isa = PBXGroup; + children = ( + 92430A8E2B10A55E0098597D /* EventType.swift */, + 92430A8F2B10A55E0098597D /* EventsManager.swift */, + 92430A922B10A5690098597D /* EventPage.swift */, + ); + path = Events; + sourceTree = ""; + }; 924F16382A45D25100B75D4E /* ViewModifiers */ = { isa = PBXGroup; children = ( @@ -3170,7 +3176,7 @@ BC4526E6251CACD500E24A51 /* Helpers */ = { isa = PBXGroup; children = ( - 5E1CE43E2AAF32A600EEE52E /* Events */, + 92430A8D2B10A55E0098597D /* Events */, BC4526E7251CACDF00E24A51 /* CodableHelper.swift */, BC1C7B38254861E7008E9A0D /* DateUtils.swift */, BC581A4D255A98DB00171D7A /* MediaRecorder.swift */, @@ -4328,7 +4334,6 @@ 5ED3B3B029F7E0BC000CFF48 /* LegacyPlanningViewModel.swift in Sources */, F52D2B84292D44D60008D047 /* ShareManagementSharedWithCollectionViewCell.swift in Sources */, F57CE596282BE9D000B06D95 /* DonateViewModel.swift in Sources */, - 5E1CE4422AAF32BE00EEE52E /* EventType.swift in Sources */, 5E7141452AFD25D5003952CD /* GiftingModel.swift in Sources */, BC59BABA25C2B7D6005A45D3 /* ShareDetailsVM.swift in Sources */, F56AA040261F1B930054B6EF /* DeviceEndpoint.swift in Sources */, @@ -4414,6 +4419,7 @@ 5E46386D276CAAF70035D8CE /* PublicProfilePersonalInfoViewController.swift in Sources */, F557A64227A190F900C061D4 /* SocialMediaProfileItem.swift in Sources */, BCCC76EB255E8BF800903D3C /* URLExtension.swift in Sources */, + 92430A912B10A55E0098597D /* EventsManager.swift in Sources */, F50E135728F43368003DF4CC /* FilesRemoteDataSource.swift in Sources */, BC6D3B5A2514F62400390927 /* AuthenticationEndpoint.swift in Sources */, 5EBAFCE42A154606005DB527 /* LegacyPlanningLoadingViewController.swift in Sources */, @@ -4451,7 +4457,6 @@ BC3DF862252DB8BA003D3829 /* LocalAuthErrors.swift in Sources */, BCD948D4258BA54600089F86 /* ItemVO.swift in Sources */, BC6D3B432513664C00390927 /* AuthViewModel.swift in Sources */, - 5E1CE4412AAF32BE00EEE52E /* EventsManager.swift in Sources */, BC6D3B552514F26F00390927 /* APIError.swift in Sources */, 5E991EDF2A48E05C006229C0 /* MetadataEditView.swift in Sources */, BC6D3B532514F0C100390927 /* APIOperation.swift in Sources */, @@ -4485,6 +4490,7 @@ BCD414DA257F80500019548F /* ShareEndpoint.swift in Sources */, BCEECDAF25B0594B00A4520E /* Downloader.swift in Sources */, 5E624DC32947BECE002D6ECB /* FusionLoginResponse.swift in Sources */, + 92430A902B10A55E0098597D /* EventType.swift in Sources */, 5EE1800724EF2A8100496AF7 /* OnboardingPageThree.swift in Sources */, BC62D57D254180D300E84DA9 /* FileInfo.swift in Sources */, BC0D99C5256DB18500D29041 /* DrawerTableViewCell.swift in Sources */, @@ -4512,6 +4518,7 @@ F5EAD0672822BBE900EC2584 /* AccountOnboardingPageThree.swift in Sources */, BC6D3B492514E45F00390927 /* EnvironmentProtocol.swift in Sources */, BCF4E5D8255C2EB2003505BA /* RecordExifVO.swift in Sources */, + 92430A932B10A5690098597D /* EventPage.swift in Sources */, F58EBC2E25DE963800D2D383 /* SharedFilesViewModel.swift in Sources */, BCEAB27F2580F6D700567E8C /* MinArchiveVO.swift in Sources */, 5EE17FFE24EE9AC500496AF7 /* OnboadingViewController.swift in Sources */, @@ -4654,6 +4661,7 @@ 5E473A022A41880A00A20D85 /* FileDownloadInfo.swift in Sources */, 5ECBAF9E2A1B5EF500FACFDF /* ArchiveSteward.swift in Sources */, 5E4739E82A4186EB00A20D85 /* VerifyCodeResponse.swift in Sources */, + 92430A942B10D5680098597D /* EventType.swift in Sources */, F559F8AB28FF02A10015A522 /* FileListType.swift in Sources */, F51B3321288B0A8500EA15DA /* FileAction.swift in Sources */, 5E1CCC22287F051D00913EEA /* ActionDialogStyle.swift in Sources */, @@ -4679,6 +4687,7 @@ F561F84A299D6E7A00B3BD09 /* ShareEndpoint.swift in Sources */, F559F88F28FEE9690015A522 /* FileBrowserViewModel.swift in Sources */, 5ED3B3B129F7E4FF000CFF48 /* LegacyPlanningStewardViewController.swift in Sources */, + 92430A952B10D56B0098597D /* EventsManager.swift in Sources */, 9220ACC32A17A768003797C9 /* LegacyPlanningStatusViewModel.swift in Sources */, 5E473A072A41887600A20D85 /* PHAssetExtension.swift in Sources */, 5ED4B9D42876E05800CF044B /* LocnVO.swift in Sources */, @@ -4793,6 +4802,7 @@ 5E473A042A41882100A20D85 /* CDNSession.swift in Sources */, F559F89C28FEEAA70015A522 /* RecordVOPayload.swift in Sources */, 5ED4B9C42875C51700CF044B /* UIImageViewExtension.swift in Sources */, + 92430A962B10D56E0098597D /* EventPage.swift in Sources */, 5E3E12452A41F16500682DE5 /* EmptyFolderView.swift in Sources */, F51B3324288B0B9800EA15DA /* MinArchiveVO.swift in Sources */, 5ED4B9C62876DF2C00CF044B /* CodableHelper.swift in Sources */, diff --git a/Permanent/App/AppDelegate.swift b/Permanent/App/AppDelegate.swift index 31127c85..b4e60cfe 100644 --- a/Permanent/App/AppDelegate.swift +++ b/Permanent/App/AppDelegate.swift @@ -28,7 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { StripeAPI.defaultPublishableKey = stripeServiceInfo.publishableKey - EventsManager.startTracker() + EventsManager.startTracker(token: mixpanelServiceInfo.token) window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = RootViewController() diff --git a/Permanent/Common/Helpers/Events/EventPage.swift b/Permanent/Common/Helpers/Events/EventPage.swift new file mode 100644 index 00000000..1eb7661e --- /dev/null +++ b/Permanent/Common/Helpers/Events/EventPage.swift @@ -0,0 +1,15 @@ +// +// EventPage.swift +// Permanent +// +// Created by Flaviu Silaghi on 24.11.2023. + +import Foundation + +enum EventPage: String { + case AccountMenu = "Account Menu" + case ArchiveMenu = "Archive Menu" + case ArchiveProfile = "Archive Profile" + case Storage = "Storage" + case RedeemGift = "RedeemGift" +} diff --git a/Permanent/Common/Helpers/Events/EventType.swift b/Permanent/Common/Helpers/Events/EventType.swift new file mode 100644 index 00000000..7986dab9 --- /dev/null +++ b/Permanent/Common/Helpers/Events/EventType.swift @@ -0,0 +1,17 @@ +// +// EventType.swift +// Permanent +// +// Created by Flaviu Silaghi on 16.08.2023. + +import Foundation + +enum EventType: String { + case SignUp = "Sign up" + case SignIn = "Sign in" + case PageView = "Screen View" + case InitiateUpload = "Initiate Upload" + case FinalizeUpload = "Finalize Upload" + case EditArchiveProfile = "Edit Archive Profile" + case PurchaseStorage = "Purchase Storage" +} diff --git a/Permanent/Helpers/Events/EventsManager.swift b/Permanent/Common/Helpers/Events/EventsManager.swift similarity index 73% rename from Permanent/Helpers/Events/EventsManager.swift rename to Permanent/Common/Helpers/Events/EventsManager.swift index a5232a4d..5f9f52bf 100644 --- a/Permanent/Helpers/Events/EventsManager.swift +++ b/Permanent/Common/Helpers/Events/EventsManager.swift @@ -9,8 +9,8 @@ import Mixpanel struct EventsManager { - static func startTracker() { - Mixpanel.initialize(token: mixpanelServiceInfo.token, trackAutomaticEvents: true) + static func startTracker(token: String) { + Mixpanel.initialize(token: token, trackAutomaticEvents: true) } static func trackEvent(event: EventType, properties: [String: any MixpanelType]? = nil) { @@ -27,6 +27,11 @@ struct EventsManager { } } + static func trackPageView(page: EventPage) { + Mixpanel.mainInstance().track(event: "Screen View", properties: ["page" : page.rawValue]) + } + + static func resetUser() { Mixpanel.mainInstance().reset() } diff --git a/Permanent/Helpers/Events/EventType.swift b/Permanent/Helpers/Events/EventType.swift deleted file mode 100644 index 33717389..00000000 --- a/Permanent/Helpers/Events/EventType.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// EventType.swift -// Permanent -// -// Created by Flaviu Silaghi on 16.08.2023. - -import Foundation - -enum EventType: String { - case SignUp = "Sign up" - case SignIn = "Sign in" -} diff --git a/Permanent/Modules/Authentication/ViewController/BiometricsViewController.swift b/Permanent/Modules/Authentication/ViewController/BiometricsViewController.swift index f8e638f4..a2a924a8 100644 --- a/Permanent/Modules/Authentication/ViewController/BiometricsViewController.swift +++ b/Permanent/Modules/Authentication/ViewController/BiometricsViewController.swift @@ -45,6 +45,7 @@ class BiometricsViewController: BaseViewController { private func attemptBiometricsAuth() { PermanentLocalAuthentication.instance.authenticate(onSuccess: { DispatchQueue.main.async { + EventsManager.trackEvent(event: .SignIn) let defaultArchive: Int? = AuthenticationManager.shared.session?.account.defaultArchiveID if defaultArchive == nil { diff --git a/Permanent/Modules/Authentication/ViewController/CodeVerificationController.swift b/Permanent/Modules/Authentication/ViewController/CodeVerificationController.swift index 416445c0..6ac103b6 100644 --- a/Permanent/Modules/Authentication/ViewController/CodeVerificationController.swift +++ b/Permanent/Modules/Authentication/ViewController/CodeVerificationController.swift @@ -66,7 +66,7 @@ class CodeVerificationController: BaseViewController { switch result { case .success: self.dismiss(animated: true) - + EventsManager.trackEvent(event: .SignIn) if AuthenticationManager.shared.session?.account.defaultArchiveID != nil { AppDelegate.shared.rootViewController.setDrawerRoot() } else { diff --git a/Permanent/Modules/Main/ViewController/MainViewController.swift b/Permanent/Modules/Main/ViewController/MainViewController.swift index 65a739fb..95122ecc 100644 --- a/Permanent/Modules/Main/ViewController/MainViewController.swift +++ b/Permanent/Modules/Main/ViewController/MainViewController.swift @@ -1254,8 +1254,11 @@ extension MainViewController: FABActionSheetDelegate { present(vc, animated: true) } - + func showActionSheet() { + EventsManager.trackEvent(event: .InitiateUpload, + properties: ["workspace": viewModel is PublicFilesViewModel ? "Public" : "Private"]) + let cameraAction = UIAlertAction(title: .takePhotoOrVideo, style: .default) { _ in self.openCamera() } let photoLibraryAction = UIAlertAction(title: .photoLibrary, style: .default) { _ in self.openPhotoLibrary() } let browseAction = UIAlertAction(title: .browse, style: .default) { _ in self.openFileBrowser() } @@ -1321,6 +1324,8 @@ extension MainViewController: FABActionSheetDelegate { let files = FileInfo.createFiles(from: urls, parentFolder: folderInfo, loadInMemory: loadInMemory) upload(files: files) + EventsManager.trackEvent(event: .FinalizeUpload, + properties: ["workspace": viewModel is PublicFilesViewModel ? "Public" : "Private"]) } private func newFolderAction() { diff --git a/Permanent/Modules/PublicProfile/ViewController/PublicArchiveViewController.swift b/Permanent/Modules/PublicProfile/ViewController/PublicArchiveViewController.swift index b607b273..3b53e2bf 100644 --- a/Permanent/Modules/PublicProfile/ViewController/PublicArchiveViewController.swift +++ b/Permanent/Modules/PublicProfile/ViewController/PublicArchiveViewController.swift @@ -40,6 +40,7 @@ class PublicArchiveViewController: BaseViewController Void)) { + EventsManager.trackEvent(event: .EditArchiveProfile) + let apiOperation: APIOperation switch operationType { diff --git a/Permanent/Modules/SideMenus/ViewController/RightSideMenuViewController.swift b/Permanent/Modules/SideMenus/ViewController/RightSideMenuViewController.swift index fd8ddab0..c6831545 100644 --- a/Permanent/Modules/SideMenus/ViewController/RightSideMenuViewController.swift +++ b/Permanent/Modules/SideMenus/ViewController/RightSideMenuViewController.swift @@ -50,6 +50,11 @@ class RightSideMenuViewController: BaseViewController { setupTableView() } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + EventsManager.trackPageView(page: .AccountMenu) + } + func initUI() { view.backgroundColor = .white tableView.backgroundColor = .white diff --git a/Permanent/Modules/SideMenus/ViewController/SideMenuViewController.swift b/Permanent/Modules/SideMenus/ViewController/SideMenuViewController.swift index 3af89a1f..bcb2f934 100644 --- a/Permanent/Modules/SideMenus/ViewController/SideMenuViewController.swift +++ b/Permanent/Modules/SideMenus/ViewController/SideMenuViewController.swift @@ -47,6 +47,12 @@ class SideMenuViewController: BaseViewController { setupTableView() } + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + EventsManager.trackPageView(page: .ArchiveMenu) + } + fileprivate func initUI() { view.backgroundColor = .primary tableView.backgroundColor = .primary diff --git a/Permanent/Modules/Storage/DonateViewController.swift b/Permanent/Modules/Storage/DonateViewController.swift index f0f3d06f..69d75062 100644 --- a/Permanent/Modules/Storage/DonateViewController.swift +++ b/Permanent/Modules/Storage/DonateViewController.swift @@ -68,6 +68,8 @@ class DonateViewController: BaseViewController { NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) + + EventsManager.trackPageView(page: .Storage) } override func viewDidAppear(_ animated: Bool) { @@ -260,7 +262,7 @@ extension DonateViewController: ApplePayContextDelegate { switch status { case .success: showAlert(title: "Thank you!".localized(), message: "Your donation was successful!".localized()) - + EventsManager.trackEvent(event: .PurchaseStorage) case .error: showErrorAlert(message: .errorMessage)