From eeabcb10ff7ba54b696e19361a3523699c1f6356 Mon Sep 17 00:00:00 2001 From: Elise Richards Date: Fri, 26 Jun 2020 16:12:18 -0500 Subject: [PATCH] Fix illegal arguments for onboarding keys (#12033) --- app/metrics.yaml | 2 +- .../org/mozilla/fenix/components/metrics/Metrics.kt | 13 +++++++------ docs/metrics.md | 10 +++++----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index 6436d9afa..a56e2fba1 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -276,7 +276,7 @@ onboarding: description: The tracking protection preference was chosen from the onboarding card. extra_keys: - position: + setting: description: | A string that indicates the Tracking Protection policy STANDARD or STRICT. Default: Toggle ON, STANDARD 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 a14351a02..46b1ea9e1 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 @@ -37,6 +37,7 @@ import org.mozilla.fenix.GleanMetrics.CrashReporter import org.mozilla.fenix.GleanMetrics.ErrorPage import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.GleanMetrics.Logins +import org.mozilla.fenix.GleanMetrics.Onboarding import org.mozilla.fenix.GleanMetrics.PerfAwesomebar import org.mozilla.fenix.GleanMetrics.SearchShortcuts import org.mozilla.fenix.GleanMetrics.Tip @@ -188,22 +189,22 @@ sealed class Event { data class OnboardingToolbarPosition(val position: Position) : Event() { enum class Position { TOP, BOTTOM } - override val extras: Map? - get() = hashMapOf(ToolbarSettings.changedPositionKeys.position to position.name) + override val extras: Map? + get() = hashMapOf(Onboarding.prefToggledToolbarPositionKeys.position to position.name) } data class OnboardingTrackingProtection(val setting: Setting) : Event() { enum class Setting { STRICT, STANDARD } - override val extras: Map? - get() = hashMapOf(TrackingProtection.etpSettingChangedKeys.etpSetting to setting.name) + override val extras: Map? + get() = hashMapOf(Onboarding.prefToggledTrackingProtKeys.setting to setting.name) } data class OnboardingThemePicker(val theme: Theme) : Event() { enum class Theme { LIGHT, DARK, FOLLOW_DEVICE } - override val extras: Map? - get() = mapOf(AppTheme.darkThemeSelectedKeys.source to theme.name) + override val extras: Map? + get() = mapOf(Onboarding.prefToggledThemePickerKeys.theme to theme.name) } data class PreferenceToggled( diff --git a/docs/metrics.md b/docs/metrics.md index 0c0cd6540..69aa677cf 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -82,10 +82,10 @@ The following metrics are added to the ping: | collections.tab_select_opened |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the select tabs screen (the first step of the collection creation flow) |[1](https://github.com/mozilla-mobile/fenix/pull/3935)||2020-09-01 | | collections.tabs_added |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user saved a list of tabs to an existing collection |[1](https://github.com/mozilla-mobile/fenix/pull/3935)|
  • tabs_open: The number of tabs open in the current session
  • tabs_selected: The number of tabs added to the collection
|2020-09-01 | | context_menu.item_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped an item in the browsers context menu |[1](https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010)|
  • named: The name of the item that was tapped. Available items are: ``` open_in_new_tab, open_in_private_tab, open_image_in_new_tab, save_image, share_link, copy_link, copy_image_location ```
|2020-09-01 | -| contextual_hint.tracking_protection.dismiss |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The enhanced tracking protection contextual hint was dismissed by pressing the close button |[1](https://github.com/mozilla-mobile/fenix/pull/TODO)||2020-09-01 | -| contextual_hint.tracking_protection.display |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The enhanced tracking protection contextual hint was displayed. |[1](https://github.com/mozilla-mobile/fenix/pull/TODO)||2020-09-01 | -| contextual_hint.tracking_protection.inside_tap |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user tapped inside of the etp contextual hint (which brings up the etp panel for this site). |[1](https://github.com/mozilla-mobile/fenix/pull/TODO)||2020-09-01 | -| contextual_hint.tracking_protection.outside_tap |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user tapped outside of the etp contextual hint (which has no effect). |[1](https://github.com/mozilla-mobile/fenix/pull/TODO)||2020-09-01 | +| contextual_hint.tracking_protection.dismiss |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The enhanced tracking protection contextual hint was dismissed by pressing the close button |[1](https://github.com/mozilla-mobile/fenix/pull/11923)||2020-09-01 | +| contextual_hint.tracking_protection.display |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The enhanced tracking protection contextual hint was displayed. |[1](https://github.com/mozilla-mobile/fenix/pull/11923)||2020-09-01 | +| contextual_hint.tracking_protection.inside_tap |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user tapped inside of the etp contextual hint (which brings up the etp panel for this site). |[1](https://github.com/mozilla-mobile/fenix/pull/11923)||2020-09-01 | +| contextual_hint.tracking_protection.outside_tap |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The user tapped outside of the etp contextual hint (which has no effect). |[1](https://github.com/mozilla-mobile/fenix/pull/11923)||2020-09-01 | | crash_reporter.closed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The crash reporter was closed |[1](https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708)|
  • crash_submitted: A boolean that tells us whether or not the user submitted a crash report
|2020-09-01 | | crash_reporter.opened |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The crash reporter was displayed |[1](https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708)||2020-09-01 | | custom_tab.action_button |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the action button provided by the launching app |[1](https://github.com/mozilla-mobile/fenix/pull/1697)||2020-09-01 | @@ -132,7 +132,7 @@ The following metrics are added to the ping: | onboarding.pref_toggled_private_browsing |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The private browsing preference was selected from the onboarding card. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)||2020-09-01 | | onboarding.pref_toggled_theme_picker |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The device theme was chosen using the theme picker onboarding card. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)|
  • theme: A string that indicates the theme LIGHT, DARK, or FOLLOW DEVICE. Default: FOLLOW DEVICE
|2020-09-01 | | onboarding.pref_toggled_toolbar_position |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The toolbar position preference was chosen from the onboarding card. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)|
  • position: A string that indicates the position of the toolbar TOP or BOTTOM. Default: BOTTOM
|2020-09-01 | -| onboarding.pref_toggled_tracking_prot |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The tracking protection preference was chosen from the onboarding card. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)|
  • position: A string that indicates the Tracking Protection policy STANDARD or STRICT. Default: Toggle ON, STANDARD
|2020-09-01 | +| onboarding.pref_toggled_tracking_prot |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The tracking protection preference was chosen from the onboarding card. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)|
  • setting: A string that indicates the Tracking Protection policy STANDARD or STRICT. Default: Toggle ON, STANDARD
|2020-09-01 | | onboarding.privacy_notice |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The onboarding privacy notice card was tapped. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)||2020-09-01 | | onboarding.whats_new |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The onboarding What\'s New card was tapped. |[1](https://github.com/mozilla-mobile/fenix/pull/11867)||2020-09-01 | | pocket.pocket_top_site_clicked |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user clicked on the trending Pocket top site |[1](https://github.com/mozilla-mobile/fenix/pull/8098)||2020-09-01 |