diff --git a/app/metrics.yaml b/app/metrics.yaml index 60dd4e79f..790c64493 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -1756,15 +1756,17 @@ tracking_protection: etp_setting_changed: type: event description: | - A user changed their tracking protection level setting to either strict or - standard. + A user changed their tracking protection level setting to either strict, + standard, or custom. extra_keys: etp_setting: - description: "The new setting for ETP: strict, standard" + description: "The new setting for ETP: strict, standard, custom" bugs: - https://github.com/mozilla-mobile/fenix/issues/5312 + - https://github.com/mozilla-mobile/fenix/issues/11063 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188 + - https://github.com/mozilla-mobile/fenix/pull/11383 notification_emails: - fenix-core@mozilla.com expires: "2020-09-01" 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 47040b186..64f0308a4 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 @@ -243,7 +243,7 @@ sealed class Event { } data class TrackingProtectionSettingChanged(val setting: Setting) : Event() { - enum class Setting { STRICT, STANDARD } + enum class Setting { STRICT, STANDARD, CUSTOM } override val extras: Map? get() = hashMapOf(TrackingProtection.etpSettingChangedKeys.etpSetting to setting.name) diff --git a/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt index 0349c69d8..4846cd1ab 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/TrackingProtectionFragment.kt @@ -111,8 +111,9 @@ class TrackingProtectionFragment : PreferenceFragmentCompat() { Event.TrackingProtectionSettingChanged.Setting.STANDARD TrackingProtectionMode.STRICT -> Event.TrackingProtectionSettingChanged.Setting.STRICT - TrackingProtectionMode.CUSTOM -> null - }?.let { setting -> + TrackingProtectionMode.CUSTOM -> + Event.TrackingProtectionSettingChanged.Setting.CUSTOM + }.let { setting -> metrics.track(Event.TrackingProtectionSettingChanged(setting)) } } diff --git a/docs/metrics.md b/docs/metrics.md index 73e9a252d..a1ef8970a 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -177,7 +177,7 @@ The following metrics are added to the ping: | top_sites.open_in_new_tab |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opens a new tab based on a top site item |[1](https://github.com/mozilla-mobile/fenix/pull/7523)||2020-09-01 | | top_sites.open_in_private_tab |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opens a new private tab based on a top site item |[1](https://github.com/mozilla-mobile/fenix/pull/7523)||2020-09-01 | | top_sites.remove |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user removes a top site item |[1](https://github.com/mozilla-mobile/fenix/pull/7523)||2020-09-01 | -| tracking_protection.etp_setting_changed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user changed their tracking protection level setting to either strict or standard. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)||2020-09-01 | +| tracking_protection.etp_setting_changed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user changed their tracking protection level setting to either strict, standard, or custom. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188), [2](https://github.com/mozilla-mobile/fenix/pull/11383)||2020-09-01 | | tracking_protection.etp_settings |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened tracking protection settings through settings. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)||2020-09-01 | | tracking_protection.etp_shield |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the tracking protection shield icon in toolbar. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)||2020-09-01 | | tracking_protection.etp_tracker_list |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed into a list of categorized trackers in tracking protection panel. |[1](https://github.com/mozilla-mobile/fenix/pull/5414#issuecomment-532847188)||2020-09-01 |