Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

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

Merged
merged 1 commit into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/org/mozilla/fenix/components/metrics/Metrics.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
}
}
Expand Down
4 changes: 3 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down