diff --git a/app/metrics.yaml b/app/metrics.yaml index 58b387e5dae8..16814cef4c94 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -5101,6 +5101,20 @@ awesomebar: - fenix-core@mozilla.com expires: "2021-08-01" +home_menu: + settings_item_clicked: + type: event + description: The user clicked the settings option in home menu. + bugs: + - https://github.com/mozilla-mobile/fenix/issues/18856 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/18856 + data_sensitivity: + - interaction + notification_emails: + - fenix-core@mozilla.com + expires: "2021-10-01" + android_keystore_experiment: experiment_failure: type: event diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt index 860a3637e539..01f2c1427d6d 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt @@ -224,6 +224,9 @@ sealed class Event { object SearchSuggestionClicked : Event() object OpenedTabSuggestionClicked : Event() + // Home menu interaction + object HomeMenuSettingsItemClicked : Event() + // Interaction events with extras data class TopSiteSwipeCarousel(val page: Int) : Event() { diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index 45eb024bbfe5..2c3ee37c8336 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -34,6 +34,7 @@ import org.mozilla.fenix.GleanMetrics.ErrorPage import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.GleanMetrics.FindInPage import org.mozilla.fenix.GleanMetrics.History +import org.mozilla.fenix.GleanMetrics.HomeMenu import org.mozilla.fenix.GleanMetrics.LoginDialog import org.mozilla.fenix.GleanMetrics.Logins import org.mozilla.fenix.GleanMetrics.MasterPassword @@ -809,6 +810,9 @@ private val Event.wrapper: EventWrapper<*>? is Event.SecurePrefsReset -> EventWrapper( { AndroidKeystoreExperiment.reset.record(it) } ) + is Event.HomeMenuSettingsItemClicked -> EventWrapper( + { HomeMenu.settingsItemClicked.record(it) } + ) // Don't record other events in Glean: is Event.AddBookmark -> null diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt index 531ecb2d76f8..e796021caa5c 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt @@ -778,6 +778,7 @@ class HomeFragment : Fragment() { R.id.homeFragment, HomeFragmentDirections.actionGlobalSettingsFragment() ) + requireComponents.analytics.metrics.track(Event.HomeMenuSettingsItemClicked) } HomeMenu.Item.SyncTabs -> { hideOnboardingIfNeeded() diff --git a/docs/metrics.md b/docs/metrics.md index 63602a25b084..f7f97dbe018e 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -154,6 +154,7 @@ In addition to those built-in metrics, the following metrics are added to the pi | history.removed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user removed a history item |[mozilla-mobile/fenix#3940](https://github.com/mozilla-mobile/fenix/pull/3940), [mozilla-mobile/fenix#15713](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 | | history.removed_all |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user removed all history items |[mozilla-mobile/fenix#3940](https://github.com/mozilla-mobile/fenix/pull/3940), [mozilla-mobile/fenix#15713](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 | | history.shared |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user shared a history item |[mozilla-mobile/fenix#3940](https://github.com/mozilla-mobile/fenix/pull/3940), [mozilla-mobile/fenix#15713](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 | +| home_menu.settings_item_clicked |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user clicked the settings option in home menu. |[mozilla-mobile/fenix#18856](https://github.com/mozilla-mobile/fenix/pull/18856)||2021-10-01 |2 | | login_dialog.cancelled |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The login dialog prompt was cancelled |[mozilla-mobile/fenix#13050](https://github.com/mozilla-mobile/fenix/pull/13050)||2021-08-01 |2 | | login_dialog.displayed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The login dialog prompt was displayed |[mozilla-mobile/fenix#13050](https://github.com/mozilla-mobile/fenix/pull/13050)||2021-08-01 |2 | | login_dialog.never_save |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The login dialog prompt "never save" button was pressed |[mozilla-mobile/fenix#13050](https://github.com/mozilla-mobile/fenix/pull/13050)||2021-08-01 |2 |