Skip to content

Commit

Permalink
Bug 1836166 - add telemetry for Mozilla Sync sign in
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonOg authored and mergify[bot] committed Jun 22, 2023
1 parent c43ad82 commit 07a7fe6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
40 changes: 38 additions & 2 deletions fenix/app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3789,7 +3789,25 @@ sync_account:
metadata:
tags:
- SendTab

settings:
sign_into_sync:
type: counter
description: |
Counts the number of times a user has clicked "sign into sync" from the settings page.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1836166
data_reviews:
- https://github.com/mozilla-mobile/firefox-android/pull/2550
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- cgordon@mozilla.com
expires: never
metadata:
tags:
- Sync
- Settings
history:
opened:
type: event
Expand Down Expand Up @@ -6414,7 +6432,25 @@ top_sites:
metadata:
tags:
- Shortcuts

app_menu:
sign_into_sync:
type: counter
description: |
Counts the number of times a user has clicked "sign into sync" from the settings page.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1836166
data_reviews:
- https://github.com/mozilla-mobile/firefox-android/pull/2550
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
- cgordon@mozilla.com
expires: never
metadata:
tags:
- Sync
- Settings
app_theme:
dark_theme_selected:
type: event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import mozilla.components.feature.top.sites.TopSite
import mozilla.components.service.glean.private.NoExtras
import mozilla.components.support.base.feature.ViewBoundFeatureWrapper
import mozilla.components.ui.widgets.withCenterAlignedButtons
import org.mozilla.fenix.GleanMetrics.AppMenu
import org.mozilla.fenix.GleanMetrics.Collections
import org.mozilla.fenix.GleanMetrics.Events
import org.mozilla.fenix.GleanMetrics.ReaderMode
Expand Down Expand Up @@ -444,8 +445,10 @@ class DefaultBrowserToolbarMenuController(
Events.browserMenuAction.record(Events.BrowserMenuActionExtra("add_to_top_sites"))
is ToolbarMenu.Item.AddToHomeScreen ->
Events.browserMenuAction.record(Events.BrowserMenuActionExtra("add_to_homescreen"))
is ToolbarMenu.Item.SyncAccount ->
is ToolbarMenu.Item.SyncAccount -> {
Events.browserMenuAction.record(Events.BrowserMenuActionExtra("sync_account"))
AppMenu.signIntoSync.add()
}
is ToolbarMenu.Item.Bookmark ->
Events.browserMenuAction.record(Events.BrowserMenuActionExtra("bookmark"))
is ToolbarMenu.Item.AddonsManager ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import org.mozilla.fenix.perf.ProfilerViewModel
import org.mozilla.fenix.settings.account.AccountUiView
import org.mozilla.fenix.utils.Settings
import kotlin.system.exitProcess
import org.mozilla.fenix.GleanMetrics.Settings as SettingsMetrics

@Suppress("LargeClass", "TooManyFunctions")
class SettingsFragment : PreferenceFragmentCompat() {
Expand Down Expand Up @@ -255,6 +256,7 @@ class SettingsFragment : PreferenceFragmentCompat() {

val directions: NavDirections? = when (preference.key) {
resources.getString(R.string.pref_key_sign_in) -> {
SettingsMetrics.signIntoSync.add()
SettingsFragmentDirections.actionSettingsFragmentToTurnOnSyncFragment(
entrypoint = FenixFxAEntryPoint.SettingsMenu,
)
Expand Down

0 comments on commit 07a7fe6

Please sign in to comment.