Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Remove Telemetry Analytics (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylehickinson authored and Joel Reis committed Jun 11, 2018
1 parent 8f1db45 commit 6e0679e
Show file tree
Hide file tree
Showing 28 changed files with 0 additions and 294 deletions.
1 change: 0 additions & 1 deletion Cartfile
Expand Up @@ -13,7 +13,6 @@ github "cezheng/Fuzi" "2.0.2"
github "SwiftyJSON/SwiftyJSON" "3.1.4"
github "farhanpatel/JSONSchema.swift" "master"
github "google/EarlGrey" "1.13.0"
github "mozilla-mobile/telemetry-ios" "v1.1.0"
github "mozilla-mobile/MappaMundi" "master"
github "path/FastImageCache" "master"
github "facebook/pop"
Expand Down
1 change: 0 additions & 1 deletion Cartfile.resolved
Expand Up @@ -12,7 +12,6 @@ github "google/EarlGrey" "1.13.0"
github "kif-framework/KIF" "v3.7.3"
github "mozilla-mobile/MappaMundi" "0b4f70e2feb941f4d56bd9e27e408d4300656a87"
github "mozilla-mobile/SwiftKeychainWrapper" "46e5980ee7630be015aae6a6307c2fe1e8f3661d"
github "mozilla-mobile/telemetry-ios" "v1.1.0"
github "path/FastImageCache" "2615d275abe6195f4a90a7b46593768b74b3b273"
github "rs/SDWebImage" "4.1.0"
github "sleroux/Deferred" "35b8927c1b94ce074e10793c57e1f80d0e2227fa"
Expand Down
9 changes: 0 additions & 9 deletions Client.xcodeproj/project.pbxproj
Expand Up @@ -741,8 +741,6 @@
EBA31D791F7999030055463D /* SyncPingCentre.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBA31D781F7999030055463D /* SyncPingCentre.swift */; };
EBA31D7B1F79990C0055463D /* SyncTelemetryEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBA31D7A1F79990C0055463D /* SyncTelemetryEvents.swift */; };
EBA31D7D1F79996E0055463D /* SyncTelemetryUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBA31D7C1F79996E0055463D /* SyncTelemetryUtils.swift */; };
EBA31D861F799BE20055463D /* Telemetry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EBA31D7E1F799BE20055463D /* Telemetry.framework */; };
EBF47E701F7979DF00899189 /* UnifiedTelemetry.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBF47E6F1F7979DF00899189 /* UnifiedTelemetry.swift */; };
F35B8D2B1D6380EA008E3D61 /* SessionRestore.html in Resources */ = {isa = PBXBuildFile; fileRef = F35B8D2A1D6380EA008E3D61 /* SessionRestore.html */; };
F35B8D2D1D6383E9008E3D61 /* SessionRestoreHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F35B8D2C1D6383E9008E3D61 /* SessionRestoreHelper.swift */; };
F35B8D2F1D638408008E3D61 /* SessionRestoreHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F35B8D2E1D638408008E3D61 /* SessionRestoreHandler.swift */; };
Expand Down Expand Up @@ -1976,8 +1974,6 @@
EBA31D781F7999030055463D /* SyncPingCentre.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncPingCentre.swift; sourceTree = "<group>"; };
EBA31D7A1F79990C0055463D /* SyncTelemetryEvents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncTelemetryEvents.swift; sourceTree = "<group>"; };
EBA31D7C1F79996E0055463D /* SyncTelemetryUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SyncTelemetryUtils.swift; sourceTree = "<group>"; };
EBA31D7E1F799BE20055463D /* Telemetry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Telemetry.framework; path = Carthage/Build/iOS/Telemetry.framework; sourceTree = "<group>"; };
EBF47E6F1F7979DF00899189 /* UnifiedTelemetry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnifiedTelemetry.swift; sourceTree = "<group>"; };
F35B8D2A1D6380EA008E3D61 /* SessionRestore.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = SessionRestore.html; sourceTree = "<group>"; };
F35B8D2C1D6383E9008E3D61 /* SessionRestoreHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionRestoreHelper.swift; sourceTree = "<group>"; };
F35B8D2E1D638408008E3D61 /* SessionRestoreHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionRestoreHandler.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2064,7 +2060,6 @@
7B604F9B1C4950F2006EEEC3 /* SDWebImage.framework in Frameworks */,
7B604FA21C495268006EEEC3 /* SnapKit.framework in Frameworks */,
3B4988CE1E42B01800A12FDA /* SwiftyJSON.framework in Frameworks */,
EBA31D861F799BE20055463D /* Telemetry.framework in Frameworks */,
7B604FBB1C495D8A006EEEC3 /* XCGLogger.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -2913,7 +2908,6 @@
A1AD4BD020BF3F4D007A6EA1 /* Eureka.framework */,
A1D841F420BC405E00BDAFF7 /* pop.framework */,
392E18021FEC4D7B00EBA79C /* MappaMundi.framework */,
EBA31D7E1F799BE20055463D /* Telemetry.framework */,
E46175F21EBB73A10021AE8A /* Sentry.framework */,
3B4988CD1E42B01800A12FDA /* SwiftyJSON.framework */,
E6231C041B90A472005ABB0D /* libxml2.2.tbd */,
Expand Down Expand Up @@ -3484,7 +3478,6 @@
isa = PBXGroup;
children = (
E69DB0BA1E97E301008A67E6 /* ActivityStreamTopics.swift */,
EBF47E6F1F7979DF00899189 /* UnifiedTelemetry.swift */,
);
path = Telemetry;
sourceTree = "<group>";
Expand Down Expand Up @@ -4936,7 +4929,6 @@
"$(SRCROOT)/Carthage/Build/iOS/JSONSchema.framework",
"$(SRCROOT)/Carthage/Build/iOS/SwiftyJSON.framework",
"$(SRCROOT)/Carthage/Build/iOS/Sentry.framework",
"$(SRCROOT)/Carthage/Build/iOS/Telemetry.framework",
"$(SRCROOT)/Carthage/Build/iOS/pop.framework",
"$(SRCROOT)/Carthage/Build/iOS/Eureka.framework",
"$(SRCROOT)/Carthage/Build/iOS/FastImageCache.framework",
Expand Down Expand Up @@ -5489,7 +5481,6 @@
E4CD9F6D1A77DD2800318571 /* ReaderModeStyleViewController.swift in Sources */,
D0FCF7F51FE45842004A7995 /* UserScriptManager.swift in Sources */,
E4A960061ABB9C450069AD6F /* ReaderModeUtils.swift in Sources */,
EBF47E701F7979DF00899189 /* UnifiedTelemetry.swift in Sources */,
E68F36981EA694000048CF44 /* PanelDataObservers.swift in Sources */,
EB07ADBE207FB3E80048D794 /* InstructionsViewController.swift in Sources */,
31ADB5DA1E58CEC300E87909 /* ClipboardBarDisplayHandler.swift in Sources */,
Expand Down
12 changes: 0 additions & 12 deletions Client/Application/AppDelegate.swift
Expand Up @@ -40,7 +40,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
let appVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String

var receivedURLs: [URL]?
var unifiedTelemetry: UnifiedTelemetry?

@discardableResult func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
//
Expand Down Expand Up @@ -104,8 +103,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati

let profile = getProfile(application)

unifiedTelemetry = UnifiedTelemetry(profile: profile)

if !DebugSettingsBundleOptions.disableLocalWebServer {
// Set up a web server that serves us static content. Do this early so that it is ready when the UI is presented.
setUpWebServer(profile)
Expand Down Expand Up @@ -239,11 +236,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati

if let profile = profile, let _ = profile.prefs.boolForKey(PrefsKeys.AppExtensionTelemetryOpenUrl) {
profile.prefs.removeObjectForKey(PrefsKeys.AppExtensionTelemetryOpenUrl)
var object = UnifiedTelemetry.EventObject.url
if case .text(_) = routerpath {
object = .searchText
}
UnifiedTelemetry.recordEvent(category: .appExtensionAction, method: .applicationOpenUrl, object: object)
}


Expand Down Expand Up @@ -293,8 +285,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
quickActions.handleShortCutItem(shortcut, withBrowserViewController: browserViewController)
quickActions.launchedShortcutItem = nil
}

UnifiedTelemetry.recordEvent(category: .action, method: .foreground, object: .app)
}

func applicationDidEnterBackground(_ application: UIApplication) {
Expand All @@ -309,8 +299,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UIViewControllerRestorati
defaults.synchronize()

syncOnDidEnterBackground(application: application)

UnifiedTelemetry.recordEvent(category: .action, method: .background, object: .app)
}

fileprivate func syncOnDidEnterBackground(application: UIApplication) {
Expand Down
7 changes: 0 additions & 7 deletions Client/Frontend/Browser/BrowserViewController.swift
Expand Up @@ -15,7 +15,6 @@ import Account
import MobileCoreServices
import SDWebImage
import SwiftyJSON
import Telemetry
import Sentry
import Deferred
import Data
Expand Down Expand Up @@ -1164,13 +1163,11 @@ extension BrowserViewController: QRCodeViewControllerDelegate {
func didScanQRCodeWithURL(_ url: URL) {
openBlankNewTab(focusLocationField: false)
finishEditingAndSubmit(url, visitType: VisitType.typed)
UnifiedTelemetry.recordEvent(category: .action, method: .scan, object: .qrCodeURL)
}

func didScanQRCodeWithText(_ text: String) {
openBlankNewTab(focusLocationField: false)
submitSearchText(text)
UnifiedTelemetry.recordEvent(category: .action, method: .scan, object: .qrCodeText)
}
}

Expand Down Expand Up @@ -1303,10 +1300,8 @@ extension BrowserViewController: URLBarDelegate {
switch readerMode.state {
case .available:
enableReaderMode()
UnifiedTelemetry.recordEvent(category: .action, method: .tap, object: .readerModeOpenButton)
case .active:
disableReaderMode()
UnifiedTelemetry.recordEvent(category: .action, method: .tap, object: .readerModeCloseButton)
case .unavailable:
break
}
Expand Down Expand Up @@ -1427,7 +1422,6 @@ extension BrowserViewController: URLBarDelegate {

if let searchURL = engine.searchURLForQuery(text) {
// We couldn't find a matching search keyword, so do a search query.
Telemetry.default.recordSearch(location: .actionBar, searchEngine: engine.engineID ?? "other")
finishEditingAndSubmit(searchURL, visitType: VisitType.typed)
} else {
// We still don't have a valid URL, so something is broken. Give up.
Expand Down Expand Up @@ -2352,7 +2346,6 @@ extension BrowserViewController: ContextMenuHelperDelegate {
let downloadAction = UIAlertAction(title: downloadTitle, style: .default) { _ in
self.pendingDownloadURL = url
currentTab.webView?.evaluateJavaScript("window.__firefox__.download('\(url.absoluteString)', '\(UserScriptManager.securityToken)')")
UnifiedTelemetry.recordEvent(category: .action, method: .tap, object: .downloadLinkButton)
}
actionSheetController.addAction(downloadAction, accessibilityIdentifier: "linkContextMenu.download")

Expand Down
Expand Up @@ -52,7 +52,6 @@ extension BrowserViewController: DownloadQueueDelegate {
let downloadCompleteToast = ButtonToast(labelText: download.filename, imageName: "check", buttonText: Strings.DownloadsButtonTitle, completion: { buttonPressed in
if buttonPressed {
self.openURLInNewTab(HomePanelType.downloads.localhostURL, isPrivate: self.tabManager.selectedTab?.isPrivate ?? false, isPrivileged: true)
UnifiedTelemetry.recordEvent(category: .action, method: .view, object: .downloadsPanel, value: .downloadCompleteToast)
}
})

Expand Down
Expand Up @@ -8,61 +8,52 @@ import Shared
extension BrowserViewController {

@objc private func reloadTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "reload"])
if let tab = tabManager.selectedTab, homePanelController == nil {
tab.reload()
}
}

@objc private func goBackKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "go-back"])
if let tab = tabManager.selectedTab, tab.canGoBack, homePanelController == nil {
tab.goBack()
}
}

@objc private func goForwardKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "go-forward"])
if let tab = tabManager.selectedTab, tab.canGoForward {
tab.goForward()
}
}

@objc private func findInPageKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "find-in-page"])
if let tab = tabManager.selectedTab, homePanelController == nil {
self.tab(tab, didSelectFindInPageForSelection: "")
}
}

@objc private func selectLocationBarKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "select-location-bar"])
scrollController.showToolbars(animated: true)
urlBar.tabLocationViewDidTapLocation(urlBar.locationView)
}

@objc private func newTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "new-tab"])
openBlankNewTab(focusLocationField: true, isPrivate: false)
}

@objc private func newPrivateTabKeyCommand() {
// NOTE: We cannot and should not distinguish between "new-tab" and "new-private-tab"
// when recording telemetry for key commands.
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "new-tab"])
openBlankNewTab(focusLocationField: true, isPrivate: true)
}

@objc private func closeTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "close-tab"])
guard let currentTab = tabManager.selectedTab else {
return
}
tabManager.removeTab(currentTab)
}

@objc private func nextTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "next-tab"])
guard let currentTab = tabManager.selectedTab else {
return
}
Expand All @@ -76,7 +67,6 @@ extension BrowserViewController {
}

@objc private func previousTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "previous-tab"])
guard let currentTab = tabManager.selectedTab else {
return
}
Expand All @@ -90,7 +80,6 @@ extension BrowserViewController {
}

@objc private func showTabTrayKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "show-tab-tray"])
showTabTray()
}

Expand Down
Expand Up @@ -21,8 +21,6 @@ extension BrowserViewController: UIDropInteractionDelegate {
}

func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) {
UnifiedTelemetry.recordEvent(category: .action, method: .drop, object: .url, value: .browser)

_ = session.loadObjects(ofClass: URL.self) { urls in
guard let url = urls.first else {
return
Expand Down
1 change: 0 additions & 1 deletion Client/Frontend/Browser/DownloadToast.swift
Expand Up @@ -172,7 +172,6 @@ class DownloadToast: Toast {
alert.addAction(UIAlertAction(title: Strings.CancelDownloadDialogCancel, style: .default, handler: { action in
self.completionHandler?(true)
self.dismiss(true)
UnifiedTelemetry.recordEvent(category: .action, method: .cancel, object: .download)
}), accessibilityIdentifier: "cancelDownloadAlert.cancel")

viewController?.present(alert, animated: true, completion: nil)
Expand Down
1 change: 0 additions & 1 deletion Client/Frontend/Browser/OpenInHelper.swift
Expand Up @@ -84,7 +84,6 @@ class DownloadHelper: NSObject, OpenInHelper {

let downloadFileItem = PhotonActionSheetItem(title: Strings.OpenInDownloadHelperAlertDownloadNow, iconString: "download") { _ in
self.browserViewController.downloadQueue.enqueueDownload(download)
UnifiedTelemetry.recordEvent(category: .action, method: .tap, object: .downloadNowButton)
}

let actions = [[filenameItem], [downloadFileItem]]
Expand Down
2 changes: 0 additions & 2 deletions Client/Frontend/Browser/ReaderModeBarView.swift
Expand Up @@ -110,7 +110,6 @@ class ReaderModeBarView: UIView {
}

@objc func tappedReadStatusButton(_ sender: UIButton!) {
UnifiedTelemetry.recordEvent(category: .action, method: .tap, object: .readingListItem, value: unread ? .markAsRead : .markAsUnread, extras: [ "from": "reader-mode-toolbar" ])
delegate?.readerModeBar(self, didSelectButton: unread ? .markAsRead : .markAsUnread)
}

Expand All @@ -119,7 +118,6 @@ class ReaderModeBarView: UIView {
}

@objc func tappedListStatusButton(_ sender: UIButton!) {
UnifiedTelemetry.recordEvent(category: .action, method: added ? .delete : .add, object: .readingListItem, value: .readerModeToolbar)
delegate?.readerModeBar(self, didSelectButton: added ? .removeFromReadingList : .addToReadingList)
}

Expand Down
6 changes: 0 additions & 6 deletions Client/Frontend/Browser/SearchViewController.swift
Expand Up @@ -5,7 +5,6 @@
import UIKit
import Shared
import Storage
import Telemetry

private enum SearchListSection: Int {
case searchSuggestions
Expand Down Expand Up @@ -266,8 +265,6 @@ class SearchViewController: SiteTableViewController, KeyboardHelperDelegate, Loa
return
}

Telemetry.default.recordSearch(location: .quickSearch, searchEngine: engine.engineID ?? "other")

searchDelegate?.searchViewController(self, didSelectURL: url)
}

Expand Down Expand Up @@ -353,7 +350,6 @@ class SearchViewController: SiteTableViewController, KeyboardHelperDelegate, Loa
if let site = data[indexPath.row] {
if let url = URL(string: site.url) {
searchDelegate?.searchViewController(self, didSelectURL: url)
UnifiedTelemetry.recordEvent(category: .action, method: .open, object: .bookmark, value: .awesomebarResults)
}
}
}
Expand Down Expand Up @@ -504,8 +500,6 @@ extension SearchViewController: SuggestionCellDelegate {
url = engine.searchURLForQuery(suggestion)
}

Telemetry.default.recordSearch(location: .suggestion, searchEngine: engine.engineID ?? "other")

if let url = url {
searchDelegate?.searchViewController(self, didSelectURL: url)
}
Expand Down
2 changes: 0 additions & 2 deletions Client/Frontend/Browser/TabLocationView.swift
Expand Up @@ -317,8 +317,6 @@ extension TabLocationView: UIDragInteractionDelegate {
return []
}

UnifiedTelemetry.recordEvent(category: .action, method: .drag, object: .locationBar)

let dragItem = UIDragItem(itemProvider: itemProvider)
return [dragItem]
}
Expand Down
5 changes: 0 additions & 5 deletions Client/Frontend/Browser/TabTrayController+KeyCommands.swift
Expand Up @@ -30,29 +30,24 @@ extension TabTrayController {
}

@objc func didCloseTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "close-tab"])
if let tab = tabManager.selectedTab {
tabManager.removeTab(tab)
}
}

@objc func didCloseAllTabsKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "close-all-tabs"])
closeTabsForCurrentTray()
}

@objc func didEnterTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "enter-tab"])
_ = self.navigationController?.popViewController(animated: true)
}

@objc func didOpenNewTabKeyCommand() {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "new-tab"])
openNewTab()
}

@objc func didChangeSelectedTabKeyCommand(sender: UIKeyCommand) {
UnifiedTelemetry.recordEvent(category: .action, method: .press, object: .keyCommand, extras: ["action": "select-tab"])
let step: Int
guard let input = sender.input else { return }
switch input {
Expand Down

0 comments on commit 6e0679e

Please sign in to comment.