diff --git a/app/metrics.yaml b/app/metrics.yaml index d52506f7b..a67df021e 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -841,6 +841,28 @@ sync_auth: notification_emails: - fenix-core@mozilla.com expires: "2020-09-01" + use_email: + type: event + description: > + A user chose to use their email to sign in instead of scanning a QR code, counterpart to "scan_pairing" + bugs: + - https://github.com/mozilla-mobile/fenix/issues/9834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/9835#pullrequestreview-398641844 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + use_email_problem: + type: event + description: > + A user chose to use their email to sign in after an account problem + bugs: + - https://github.com/mozilla-mobile/fenix/issues/9834 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/9835#pullrequestreview-398641844 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" sign_in: type: event description: > diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index 750c314c4..73fc35806 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -217,6 +217,12 @@ private val Event.wrapper: EventWrapper<*>? is Event.SyncAuthClosed -> EventWrapper( { SyncAuth.closed.record(it) } ) + is Event.SyncAuthUseEmail -> EventWrapper( + { SyncAuth.useEmail.record(it) } + ) + is Event.SyncAuthUseEmailProblem -> EventWrapper( + { SyncAuth.useEmailProblem.record(it) } + ) is Event.SyncAuthSignIn -> EventWrapper( { SyncAuth.signIn.record(it) } ) 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 308429029..e8618536b 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 @@ -75,6 +75,8 @@ sealed class Event { object SyncAuthSignIn : Event() object SyncAuthSignOut : Event() object SyncAuthScanPairing : Event() + object SyncAuthUseEmail : Event() + object SyncAuthUseEmailProblem : Event() object SyncAuthPaired : Event() object SyncAuthRecovered : Event() object SyncAuthOtherExternal : Event() diff --git a/app/src/main/java/org/mozilla/fenix/settings/account/AccountProblemFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/account/AccountProblemFragment.kt index b5d92eacc..bbbf84ef3 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/account/AccountProblemFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/account/AccountProblemFragment.kt @@ -15,6 +15,7 @@ import mozilla.components.concept.sync.AccountObserver import mozilla.components.concept.sync.AuthType import mozilla.components.concept.sync.OAuthAccount import org.mozilla.fenix.R +import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.getPreferenceKey import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.requireComponents @@ -24,6 +25,7 @@ class AccountProblemFragment : PreferenceFragmentCompat(), AccountObserver { private val signInClickListener = Preference.OnPreferenceClickListener { requireComponents.services.accountsAuthFeature.beginAuthentication(requireContext()) + requireComponents.analytics.metrics.track(Event.SyncAuthUseEmailProblem) // TODO The sign-in web content populates session history, // so pressing "back" after signing in won't take us back into the settings screen, but rather up the // session history stack. diff --git a/app/src/main/java/org/mozilla/fenix/settings/account/TurnOnSyncFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/account/TurnOnSyncFragment.kt index dd71e1f73..ee76bc2f2 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/account/TurnOnSyncFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/account/TurnOnSyncFragment.kt @@ -29,6 +29,7 @@ class TurnOnSyncFragment : Fragment(), AccountObserver { private val signInClickListener = View.OnClickListener { requireComponents.services.accountsAuthFeature.beginAuthentication(requireContext()) + requireComponents.analytics.metrics.track(Event.SyncAuthUseEmail) // TODO The sign-in web content populates session history, // so pressing "back" after signing in won't take us back into the settings screen, but rather up the // session history stack. diff --git a/docs/metrics.md b/docs/metrics.md index 1ddcfee3a..685e37ba0 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -175,6 +175,8 @@ The following metrics are added to the ping: | sync_auth.sign_in |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the sign in button on the sync authentication page and was successfully signed in to FxA |[1](https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532)||2020-09-01 | | sync_auth.sign_out |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the sign out button on the sync account page and was successfully signed out of FxA |[1](https://github.com/mozilla-mobile/fenix/pull/2745#issuecomment-494918532)||2020-09-01 | | sync_auth.sign_up |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |User registered a new Firefox Account, and was signed into it |[1](https://github.com/mozilla-mobile/fenix/pull/4931#issuecomment-529740300)||2020-09-01 | +| sync_auth.use_email |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user chose to use their email to sign in instead of scanning a QR code, counterpart to "scan_pairing" |[1](https://github.com/mozilla-mobile/fenix/pull/9835#pullrequestreview-398641844)||2020-09-01 | +| sync_auth.use_email_problem |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user chose to use their email to sign in after an account problem |[1](https://github.com/mozilla-mobile/fenix/pull/9835#pullrequestreview-398641844)||2020-09-01 | | tab.media_pause |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the pause icon on a tab from the home screen |[1](https://github.com/mozilla-mobile/fenix/pull/5266)||2020-09-01 | | tab.media_play |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user pressed the play icon on a tab from the home screen |[1](https://github.com/mozilla-mobile/fenix/pull/5266)||2020-09-01 | | tip.closed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The tip was closed |[1](https://github.com/mozilla-mobile/fenix/pull/9836)|
  • identifier: The identifier of the tip closed
|2020-09-01 |