1
0
Fork 0

For #6834: Adds telemetry for About page items

Didn't change the existing probe for 'whats new' item because we're already
collecting that info.
master
ValentinTimisica 2020-02-03 15:17:49 +02:00 committed by Jeff Boek
parent 7b9f74138c
commit 2026c60136
5 changed files with 101 additions and 3 deletions

View File

@ -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"

View File

@ -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<NoExtraKeys>(
{ TopSites.remove.record(it) }
)
is Event.SupportTapped -> EventWrapper<NoExtraKeys>(
{ AboutPage.supportTapped.record(it) }
)
is Event.PrivacyNoticeTapped -> EventWrapper<NoExtraKeys>(
{ AboutPage.privacyNoticeTapped.record(it) }
)
is Event.RightsTapped -> EventWrapper<NoExtraKeys>(
{ AboutPage.rightsTapped.record(it) }
)
is Event.LicensingTapped -> EventWrapper<NoExtraKeys>(
{ AboutPage.licensingTapped.record(it) }
)
is Event.LibrariesThatWeUseTapped -> EventWrapper<NoExtraKeys>(
{ AboutPage.librariesTapped.record(it) }
)
// Don't record other events in Glean:
is Event.AddBookmark -> null
is Event.OpenedBookmark -> null

View File

@ -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

View File

@ -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()
}
}

View File

@ -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 |