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

Commit

Permalink
For #8920 - [Telemetry] Send add-on ids in a metrics ping
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielluong committed May 30, 2020
1 parent ce15763 commit 8aa4012
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions app/metrics.yaml
Expand Up @@ -2212,6 +2212,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
Expand Up @@ -30,6 +30,7 @@ import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.webextensions.facts.WebExtensionFacts
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.GleanMetrics.Addons
import org.mozilla.fenix.GleanMetrics.Addons.installedAddons
import org.mozilla.fenix.GleanMetrics.AppTheme
import org.mozilla.fenix.GleanMetrics.Collections
import org.mozilla.fenix.GleanMetrics.ContextMenu
Expand Down Expand Up @@ -475,12 +476,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
2 changes: 2 additions & 0 deletions docs/metrics.md
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

0 comments on commit 8aa4012

Please sign in to comment.