For #5586 - Adds Logins Telemetry (#6352)

* For #5586 - Adds Logins Telemetry

* Adds Logins Sync Telemetry to PreferenceToggled event
staging
Emily Kager 5 years ago committed by Jeff Boek
parent f6a66562dd
commit cc318021cc

@ -108,23 +108,26 @@ events:
preference_toggled:
type: event
description: >
A user toggled a preference switch in settings
A user toggled a boolean preference in settings
extra_keys:
preference_key:
description: "The preference key for the switch preference the user toggled. We currently track:
description: "The preference key for the boolean (true/false) preference the user toggled. We currently track:
show_search_suggestions, remote_debugging, telemetry, tracking_protection, search_bookmarks,
search_browsing_history, show_clipboard_suggestions, show_search_shortcuts, and open_links_in_a_private_tab"
search_browsing_history, show_clipboard_suggestions, show_search_shortcuts, open_links_in_a_private_tab,
and pref_key_sync_logins"
enabled:
description: "Whether or not the preference is *now* enabled"
bugs:
- https://github.com/mozilla-mobile/fenix/issue/975
- https://github.com/mozilla-mobile/fenix/issue/5094
- https://github.com/mozilla-mobile/fenix/issues/5737
- https://github.com/mozilla-mobile/fenix/issues/5586
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/1896
- https://github.com/mozilla-mobile/fenix/pull/5704
- https://github.com/mozilla-mobile/fenix/pull/5886
- https://github.com/mozilla-mobile/fenix/pull/5975
- https://github.com/mozilla-mobile/fenix/pull/6352
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
@ -1443,6 +1446,52 @@ media_notification:
- fenix-core@mozilla.com
expires: "2020-03-01"
logins:
open_logins:
type: event
description: >
A user accessed Logins in Settings
bugs:
- https://github.com/mozilla-mobile/fenix/issues/5586
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/6352
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
open_individual_login:
type: event
description: >
A user accessed an individual login in saved logins
bugs:
- https://github.com/mozilla-mobile/fenix/issues/5586
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/6352
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
copy_login:
type: event
description: >
A user copied a piece of a login in saved logins
bugs:
- https://github.com/mozilla-mobile/fenix/issues/5586
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/6352
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
view_password_login:
type: event
description: >
A user viewed a password in an individual saved login
bugs:
- https://github.com/mozilla-mobile/fenix/issues/5586
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/6352
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
experiments.metrics:
active_experiment:
type: string

@ -25,6 +25,7 @@ import org.mozilla.fenix.GleanMetrics.Events
import org.mozilla.fenix.GleanMetrics.FindInPage
import org.mozilla.fenix.GleanMetrics.History
import org.mozilla.fenix.GleanMetrics.Library
import org.mozilla.fenix.GleanMetrics.Logins
import org.mozilla.fenix.GleanMetrics.MediaNotification
import org.mozilla.fenix.GleanMetrics.Metrics
import org.mozilla.fenix.GleanMetrics.Pings
@ -401,6 +402,18 @@ private val Event.wrapper: EventWrapper<*>?
{ Events.openedLink.record(it) },
{ Events.openedLinkKeys.valueOf(it) }
)
is Event.OpenLogins -> EventWrapper<NoExtraKeys>(
{ Logins.openLogins.record(it) }
)
is Event.OpenOneLogin -> EventWrapper<NoExtraKeys>(
{ Logins.openIndividualLogin.record(it) }
)
is Event.CopyLogin -> EventWrapper<NoExtraKeys>(
{ Logins.copyLogin.record(it) }
)
is Event.ViewLoginPassword -> EventWrapper<NoExtraKeys>(
{ Logins.viewPasswordLogin.record(it) }
)
// Don't record other events in Glean:
is Event.AddBookmark -> null
is Event.OpenedBookmark -> null

@ -120,11 +120,15 @@ sealed class Event {
object TrackingProtectionSettingsPanel : Event()
object TrackingProtectionSettings : Event()
object TrackingProtectionException : Event()
object OpenLogins : Event()
object OpenOneLogin : Event()
object CopyLogin : Event()
object ViewLoginPassword : Event()
// Interaction events with extras
data class PreferenceToggled(val preferenceKey: String, val enabled: Boolean, val context: Context) : Event() {
private val switchPreferenceTelemetryAllowList = listOf(
private val booleanPreferenceTelemetryAllowList = listOf(
context.getString(R.string.pref_key_show_search_suggestions),
context.getString(R.string.pref_key_remote_debugging),
context.getString(R.string.pref_key_telemetry),
@ -133,7 +137,8 @@ sealed class Event {
context.getString(R.string.pref_key_search_browsing_history),
context.getString(R.string.pref_key_show_clipboard_suggestions),
context.getString(R.string.pref_key_show_search_shortcuts),
context.getString(R.string.pref_key_open_links_in_a_private_tab)
context.getString(R.string.pref_key_open_links_in_a_private_tab),
context.getString(R.string.pref_key_sync_logins)
)
override val extras: Map<Events.preferenceToggledKeys, String>?
@ -144,7 +149,7 @@ sealed class Event {
init {
// If the event is not in the allow list, we don't want to track it
if (!switchPreferenceTelemetryAllowList.contains(preferenceKey)) { throw IllegalArgumentException() }
require(booleanPreferenceTelemetryAllowList.contains(preferenceKey))
}
}

@ -14,6 +14,7 @@ import com.google.android.material.snackbar.Snackbar
import kotlinx.android.synthetic.main.fragment_saved_login_site_info.*
import org.mozilla.fenix.R
import org.mozilla.fenix.components.FenixSnackbar
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
class SavedLoginSiteInfoFragment : Fragment(R.layout.fragment_saved_login_site_info) {
@ -58,6 +59,7 @@ class SavedLoginSiteInfoFragment : Fragment(R.layout.fragment_saved_login_site_i
val clipboard = view.context.components.clipboardHandler
clipboard.text = savedLoginItem.password
showCopiedSnackbar(getString(R.string.logins_password_copied))
context?.components?.analytics?.metrics?.track(Event.CopyLogin)
}
}
@ -69,6 +71,7 @@ class SavedLoginSiteInfoFragment : Fragment(R.layout.fragment_saved_login_site_i
private fun togglePasswordReveal() {
if (passwordInfoText.inputType == InputType.TYPE_TEXT_VARIATION_PASSWORD or InputType.TYPE_CLASS_TEXT) {
context?.components?.analytics?.metrics?.track(Event.ViewLoginPassword)
revealPasswordItem.setImageDrawable(context?.getDrawable(R.drawable.ic_password_hide))
passwordInfoText.inputType = InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
revealPasswordItem.contentDescription =

@ -22,6 +22,7 @@ import kotlinx.coroutines.launch
import mozilla.components.lib.state.ext.consumeFrom
import org.mozilla.fenix.R
import org.mozilla.fenix.components.StoreProvider
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
class SavedLoginsFragment : Fragment() {
@ -70,6 +71,7 @@ class SavedLoginsFragment : Fragment() {
}
private fun itemClicked(item: SavedLoginsItem) {
context?.components?.analytics?.metrics?.track(Event.OpenOneLogin)
val directions =
SavedLoginsFragmentDirections.actionSavedLoginsFragmentToSavedLoginSiteInfoFragment(item)
findNavController().navigate(directions)

@ -29,6 +29,8 @@ import mozilla.components.concept.sync.OAuthAccount
import mozilla.components.service.fxa.SyncEngine
import mozilla.components.service.fxa.manager.SyncEnginesStorage
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.ext.requireComponents
import org.mozilla.fenix.ext.settings
@ -234,6 +236,7 @@ class LoginsFragment : PreferenceFragmentCompat(), AccountObserver {
}
private fun navigateToSavedLoginsFragment() {
context?.components?.analytics?.metrics?.track(Event.OpenLogins)
val directions = LoginsFragmentDirections.actionLoginsFragmentToSavedLoginsFragment()
findNavController().navigate(directions)
}

@ -78,7 +78,7 @@ The following metrics are added to the ping:
| events.entered_url |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user entered a url |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673)|<ul><li>autocomplete: A boolean that tells us whether the URL was autofilled by an Autocomplete suggestion</li></ul>|2020-03-01 |
| events.opened_link |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened a link with Fenix |[1](https://github.com/mozilla-mobile/fenix/pull/5975)|<ul><li>mode: The mode the link was opened in. Either 'PRIVATE' or 'NORMAL'</li></ul>|2020-03-01 |
| events.performed_search |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user performed a search |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673), [2](https://github.com/mozilla-mobile/fenix/pull/1677)|<ul><li>source: A string that tells us how the user performed the search. Possible values are: * default.action * default.suggestion * shortcut.action * shortcut.suggestion </li></ul>|2020-03-01 |
| events.preference_toggled |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user toggled a preference switch in settings |[1](https://github.com/mozilla-mobile/fenix/pull/1896), [2](https://github.com/mozilla-mobile/fenix/pull/5704), [3](https://github.com/mozilla-mobile/fenix/pull/5886), [4](https://github.com/mozilla-mobile/fenix/pull/5975)|<ul><li>enabled: Whether or not the preference is *now* enabled</li><li>preference_key: The preference key for the switch preference the user toggled. We currently track: show_search_suggestions, remote_debugging, telemetry, tracking_protection, search_bookmarks, search_browsing_history, show_clipboard_suggestions, show_search_shortcuts, and open_links_in_a_private_tab</li></ul>|2020-03-01 |
| events.preference_toggled |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user toggled a boolean preference in settings |[1](https://github.com/mozilla-mobile/fenix/pull/1896), [2](https://github.com/mozilla-mobile/fenix/pull/5704), [3](https://github.com/mozilla-mobile/fenix/pull/5886), [4](https://github.com/mozilla-mobile/fenix/pull/5975), [5](https://github.com/mozilla-mobile/fenix/pull/6352)|<ul><li>enabled: Whether or not the preference is *now* enabled</li><li>preference_key: The preference key for the boolean (true/false) preference the user toggled. We currently track: show_search_suggestions, remote_debugging, telemetry, tracking_protection, search_bookmarks, search_browsing_history, show_clipboard_suggestions, show_search_shortcuts, open_links_in_a_private_tab, and pref_key_sync_logins</li></ul>|2020-03-01 |
| events.search_bar_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user tapped the search bar |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673)|<ul><li>source: The view the user was on when they initiated the search (For example: `Home` or `Browser`)</li></ul>|2020-03-01 |
| events.whats_new_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the "what's new" page button |[1](https://github.com/mozilla-mobile/fenix/pull/5090)|<ul><li>source: The location from which the user selected the what's new button. Either 'about' or 'home'</li></ul>|2020-03-01 |
| find_in_page.closed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user closed the find in page UI |[1](https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010)||2020-03-01 |
@ -94,6 +94,10 @@ The following metrics are added to the ping:
| library.closed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user closed the library |[1](https://github.com/mozilla-mobile/fenix/pull/2538#issuecomment-492830242)||2020-03-01 |
| library.opened |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the library |[1](https://github.com/mozilla-mobile/fenix/pull/2538#issuecomment-492830242)||2020-03-01 |
| library.selected_item |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user selected a library item |[1](https://github.com/mozilla-mobile/fenix/pull/2538#issuecomment-492830242)|<ul><li>item: The library item the user selected</li></ul>|2020-03-01 |
| logins.copy_login |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user copied a piece of a login in saved logins |[1](https://github.com/mozilla-mobile/fenix/pull/6352)||2020-03-01 |
| logins.open_individual_login |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user accessed an individual login in saved logins |[1](https://github.com/mozilla-mobile/fenix/pull/6352)||2020-03-01 |
| logins.open_logins |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user accessed Logins in Settings |[1](https://github.com/mozilla-mobile/fenix/pull/6352)||2020-03-01 |
| logins.view_password_login |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user viewed a password in an individual saved login |[1](https://github.com/mozilla-mobile/fenix/pull/6352)||2020-03-01 |
| media_notification.pause |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the pause icon on the media notification |[1](https://github.com/mozilla-mobile/fenix/pull/5520)||2020-03-01 |
| media_notification.play |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the play icon on the media notification |[1](https://github.com/mozilla-mobile/fenix/pull/5520)||2020-03-01 |
| private_browsing_mode.garbage_icon |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the garbage can icon on the private browsing home page, deleting all private tabs. |[1](https://github.com/mozilla-mobile/fenix/pull/4968)||2020-03-01 |

Loading…
Cancel
Save