1
0
Fork 0

For #8920 - [Telemetry] Send add-on ids in a metrics ping

master
Gabriel Luong 2020-05-30 02:12:03 -04:00 committed by Jeff Boek
parent e3029d658a
commit 9520c9dd32
4 changed files with 46 additions and 5 deletions

View File

@ -2179,6 +2179,10 @@ addons:
type: event
description: |
A user interacted with an installed add-on in the toolbar menu
extra_keys:
addon_id:
description: |
The id of the add-on that was interacted with in the toolbar menu
bugs:
- https://github.com/mozilla-mobile/fenix/issues/6174
data_reviews:
@ -2212,6 +2216,32 @@ addons:
notification_emails:
- fenix-core@mozilla.com
expires: "2020-09-01"
installed_addons:
type: string_list
description: |
A list of all installed add-ons on the device.
send_in_pings:
- metrics
bugs:
- https://github.com/mozilla-mobile/fenix/issues/8920
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/11080
notification_emails:
- fenix-core@mozilla.com
expires: "2020-09-01"
enabled_addons:
type: string_list
description: |
A list of all enabled add-ons on the device.
send_in_pings:
- metrics
bugs:
- https://github.com/mozilla-mobile/fenix/issues/8920
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/11080
notification_emails:
- fenix-core@mozilla.com
expires: "2020-09-01"
startup.timeline:
framework_start:

View File

@ -512,8 +512,9 @@ private val Event.wrapper: EventWrapper<*>?
is Event.AddonsOpenInSettings -> EventWrapper<NoExtraKeys>(
{ Addons.openAddonsInSettings.record(it) }
)
is Event.AddonsOpenInToolbarMenu -> EventWrapper<NoExtraKeys>(
{ Addons.openAddonInToolbarMenu.record(it) }
is Event.AddonsOpenInToolbarMenu -> EventWrapper(
{ Addons.openAddonInToolbarMenu.record(it) },
{ Addons.openAddonInToolbarMenuKeys.valueOf(it) }
)
is Event.TipDisplayed -> EventWrapper(
{ Tip.displayed.record(it) },

View File

@ -166,7 +166,6 @@ sealed class Event {
object PocketTopSiteRemoved : Event()
object FennecToFenixMigrated : Event()
object AddonsOpenInSettings : Event()
object AddonsOpenInToolbarMenu : Event()
object VoiceSearchTapped : Event()
object SearchWidgetCFRDisplayed : Event()
object SearchWidgetCFRCanceled : Event()
@ -209,6 +208,11 @@ sealed class Event {
}
}
data class AddonsOpenInToolbarMenu(val addonId: String) : Event() {
override val extras: Map<Addons.openAddonInToolbarMenuKeys, String>?
get() = hashMapOf(Addons.openAddonInToolbarMenuKeys.addonId to addonId)
}
data class TipDisplayed(val identifier: String) : Event() {
override val extras: Map<Tip.displayedKeys, String>?
get() = hashMapOf(Tip.displayedKeys.identifier to identifier)
@ -442,7 +446,9 @@ private fun Fact.toEvent(): Event? = when (Pair(component, item)) {
Component.BROWSER_TOOLBAR to ToolbarFacts.Items.MENU -> {
metadata?.get("customTab")?.let { Event.CustomTabsMenuOpened }
}
Component.BROWSER_MENU to BrowserMenuFacts.Items.WEB_EXTENSION_MENU_ITEM -> Event.AddonsOpenInToolbarMenu
Component.BROWSER_MENU to BrowserMenuFacts.Items.WEB_EXTENSION_MENU_ITEM -> {
metadata?.get("id")?.let { Event.AddonsOpenInToolbarMenu(it.toString()) }
}
Component.FEATURE_CUSTOMTABS to CustomTabsFacts.Items.CLOSE -> Event.CustomTabsClosed
Component.FEATURE_CUSTOMTABS to CustomTabsFacts.Items.ACTION_BUTTON -> Event.CustomTabsActionTapped
@ -475,12 +481,14 @@ private fun Fact.toEvent(): Event? = when (Pair(component, item)) {
Component.SUPPORT_WEBEXTENSIONS to WebExtensionFacts.Items.WEB_EXTENSIONS_INITIALIZED -> {
metadata?.get("installed")?.let { installedAddons ->
if (installedAddons is List<*>) {
Addons.installedAddons.set(installedAddons.map { it.toString() })
Addons.hasInstalledAddons.set(installedAddons.size > 0)
}
}
metadata?.get("enabled")?.let { enabledAddons ->
if (enabledAddons is List<*>) {
Addons.enabledAddons.set(enabledAddons.map { it.toString() })
Addons.hasEnabledAddons.set(enabledAddons.size > 0)
}
}

View File

@ -53,7 +53,7 @@ The following metrics are added to the ping:
| 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 |
| addons.open_addon_in_toolbar_menu |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user interacted with an installed add-on in the toolbar menu |[1](https://github.com/mozilla-mobile/fenix/pull/8318)||2020-09-01 |
| addons.open_addon_in_toolbar_menu |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user interacted with an installed add-on in the toolbar menu |[1](https://github.com/mozilla-mobile/fenix/pull/8318)|<ul><li>addon_id: The id of the add-on that was interacted with in the toolbar menu </li></ul>|2020-09-01 |
| addons.open_addons_in_settings |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user accessed "Add-ons" from the Settings |[1](https://github.com/mozilla-mobile/fenix/pull/8318)||2020-09-01 |
| app_theme.dark_theme_selected |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user selected Dark Theme |[1](https://github.com/mozilla-mobile/fenix/pull/7968)|<ul><li>source: The source from where dark theme was selected. The source can be 'SETTINGS' or 'ONBOARDING' </li></ul>|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 |
@ -222,8 +222,10 @@ The following metrics are added to the ping:
| Name | Type | Description | Data reviews | Extras | Expiration |
| --- | --- | --- | --- | --- | --- |
| addons.enabled_addons |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |A list of all enabled add-ons on the device. |[1](https://github.com/mozilla-mobile/fenix/pull/11080)||2020-09-01 |
| addons.has_enabled_addons |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |Whether or not the user has enabled add-ons on the device. |[1](https://github.com/mozilla-mobile/fenix/pull/8318)||2020-09-01 |
| addons.has_installed_addons |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |Whether or not the user has installed add-ons on the device. |[1](https://github.com/mozilla-mobile/fenix/pull/8318)||2020-09-01 |
| addons.installed_addons |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |A list of all installed add-ons on the device. |[1](https://github.com/mozilla-mobile/fenix/pull/11080)||2020-09-01 |
| browser.search.ad_clicks |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Records clicks of adverts on SERP pages. The key format is <provider-name>. |[1](https://github.com/mozilla-mobile/fenix/pull/10112)||2020-09-01 |
| browser.search.in_content |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Records the type of interaction a user has on SERP pages. |[1](https://github.com/mozilla-mobile/fenix/pull/10167)||2020-09-01 |
| browser.search.with_ads |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Records counts of SERP pages with adverts displayed. The key format is <provider-name>. |[1](https://github.com/mozilla-mobile/fenix/pull/10112)||2020-09-01 |