diff --git a/app/metrics.yaml b/app/metrics.yaml index 5073eece1..9566559eb 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -1703,3 +1703,60 @@ top_sites: notification_emails: - fenix-core@mozilla.com expires: "2020-09-01" + +about_page: + support_tapped: + type: event + description: > + A user tapped on "Support" item from About page + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/8047 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + privacy_notice_tapped: + type: event + description: > + A user tapped on "Privacy notice" item from About page + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/8047 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + rights_tapped: + type: event + description: > + A user tapped on "Know your rights" item from About page + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/8047 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + licensing_tapped: + type: event + description: > + A user tapped on "Licensing information" item from About page + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/8047 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + libraries_tapped: + type: event + description: > + A user tapped on "Libraries that we use" item from About page + bugs: + - https://github.com/mozilla-mobile/fenix/issues/6834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/8047 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" 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 7183394db..0bcd5c8c5 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 @@ -11,6 +11,7 @@ import kotlinx.coroutines.MainScope import mozilla.components.service.glean.Glean import mozilla.components.service.glean.private.NoExtraKeys import mozilla.components.support.base.log.logger.Logger +import org.mozilla.fenix.GleanMetrics.AboutPage import org.mozilla.fenix.GleanMetrics.BookmarksManagement import org.mozilla.fenix.GleanMetrics.Collections import org.mozilla.fenix.GleanMetrics.ContextMenu @@ -466,6 +467,21 @@ private val Event.wrapper: EventWrapper<*>? is Event.TopSiteRemoved -> EventWrapper( { TopSites.remove.record(it) } ) + is Event.SupportTapped -> EventWrapper( + { AboutPage.supportTapped.record(it) } + ) + is Event.PrivacyNoticeTapped -> EventWrapper( + { AboutPage.privacyNoticeTapped.record(it) } + ) + is Event.RightsTapped -> EventWrapper( + { AboutPage.rightsTapped.record(it) } + ) + is Event.LicensingTapped -> EventWrapper( + { AboutPage.licensingTapped.record(it) } + ) + is Event.LibrariesThatWeUseTapped -> EventWrapper( + { AboutPage.librariesTapped.record(it) } + ) // Don't record other events in Glean: is Event.AddBookmark -> null is Event.OpenedBookmark -> null diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt index 28800a588..484d42cba 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt @@ -143,6 +143,11 @@ sealed class Event { object CustomEngineDeleted : Event() object PrivateBrowsingShowSearchSuggestions : Event() object WhatsNewTapped : Event() + object SupportTapped : Event() + object PrivacyNoticeTapped : Event() + object RightsTapped : Event() + object LicensingTapped : Event() + object LibrariesThatWeUseTapped : Event() // Interaction events with extras diff --git a/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt index 1bfb180f7..0d7f08db8 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/about/AboutFragment.kt @@ -149,14 +149,29 @@ class AboutFragment : Fragment(), AboutPageListener { override fun onAboutItemClicked(item: AboutItem) { Do exhaustive when (item) { is AboutItem.ExternalLink -> { - if (item.type == WHATS_NEW) { - WhatsNew.userViewedWhatsNew(requireContext()) - requireComponents.analytics.metrics.track(Event.WhatsNewTapped) + when (item.type) { + WHATS_NEW -> { + WhatsNew.userViewedWhatsNew(requireContext()) + requireComponents.analytics.metrics.track(Event.WhatsNewTapped) + } + SUPPORT -> { + requireComponents.analytics.metrics.track(Event.SupportTapped) + } + PRIVACY_NOTICE -> { + requireComponents.analytics.metrics.track(Event.PrivacyNoticeTapped) + } + RIGHTS -> { + requireComponents.analytics.metrics.track(Event.RightsTapped) + } + LICENSING_INFO -> { + requireComponents.analytics.metrics.track(Event.LicensingTapped) + } } openLinkInCustomTab(item.url) } is AboutItem.Libraries -> { + requireComponents.analytics.metrics.track(Event.LibrariesThatWeUseTapped) openLibrariesPage() } } diff --git a/docs/metrics.md b/docs/metrics.md index b07b21ff0..019fd9174 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -40,6 +40,11 @@ The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | +| about_page.libraries_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on "Libraries that we use" item from About page |[1](https://github.com/mozilla-mobile/fenix/pull/8047)||2020-09-01 | +| about_page.licensing_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on "Licensing information" item from About page |[1](https://github.com/mozilla-mobile/fenix/pull/8047)||2020-09-01 | +| about_page.privacy_notice_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on "Privacy notice" item from About page |[1](https://github.com/mozilla-mobile/fenix/pull/8047)||2020-09-01 | +| about_page.rights_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on "Know your rights" item from About page |[1](https://github.com/mozilla-mobile/fenix/pull/8047)||2020-09-01 | +| about_page.support_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped on "Support" item from About page |[1](https://github.com/mozilla-mobile/fenix/pull/8047)||2020-09-01 | | bookmarks_management.copied |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user copied a bookmark. |[1](https://github.com/mozilla-mobile/fenix/pull/1708)||2020-09-01 | | bookmarks_management.edited |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user edited the title and/or URL of an existing bookmark. |[1](https://github.com/mozilla-mobile/fenix/pull/1708)||2020-09-01 | | bookmarks_management.folder_add |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user added a new bookmark folder. |[1](https://github.com/mozilla-mobile/fenix/pull/1708)||2020-09-01 |