diff --git a/app/metrics.yaml b/app/metrics.yaml index f2ce0f37d..3845454aa 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -793,6 +793,17 @@ sync_auth: notification_emails: - fenix-core@mozilla.com expires: "2020-03-01" + sign_up: + type: event + description: > + A user signed up for a new FxA account + bugs: + - 4421 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/4816 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-03-01" scan_pairing: type: event description: > diff --git a/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt b/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt index 369f58d27..804b133d9 100644 --- a/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/collections/CreateCollectionFragment.kt @@ -121,7 +121,7 @@ class CreateCollectionFragment : DialogFragment() { } context.components.analytics.metrics.track( - Event.CollectionSaved(context.components.core.sessionManager.size, sessionBundle.size) + Event.CollectionSaved(normalSessionSize(), sessionBundle.size) ) closeTabsIfNecessary(it.tabs) @@ -137,7 +137,7 @@ class CreateCollectionFragment : DialogFragment() { } context.components.analytics.metrics.track( - Event.CollectionTabsAdded(context.components.core.sessionManager.size, sessionBundle.size) + Event.CollectionTabsAdded(normalSessionSize(), sessionBundle.size) ) closeTabsIfNecessary(it.tabs) @@ -154,6 +154,12 @@ class CreateCollectionFragment : DialogFragment() { } } + private fun normalSessionSize(): Int { + return requireComponents.core.sessionManager.sessions.filter { session -> + (!session.isCustomTabSession() && !session.private) + }.size + } + private fun handleBackPress(backPressFrom: SaveCollectionStep) { when (backPressFrom) { SaveCollectionStep.SelectTabs -> dismiss() 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 d8c7af289..c1024bd50 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 @@ -212,6 +212,9 @@ private val Event.wrapper is Event.SyncAuthSignOut -> EventWrapper( { SyncAuth.signOut.record(it) } ) + is Event.FXANewSignup -> EventWrapper( + { SyncAuth.signUp.record(it) } + ) is Event.SyncAuthScanPairing -> EventWrapper( { SyncAuth.scanPairing.record(it) } ) @@ -300,9 +303,6 @@ private val Event.wrapper is Event.SearchWidgetVoiceSearchPressed -> EventWrapper( { SearchWidget.voiceButton.record(it) } ) - is Event.FXANewSignup -> EventWrapper( - { Collections.renameButton.record(it) } - ) // Don't track other events with Glean else -> null diff --git a/docs/metrics.md b/docs/metrics.md index 46af067b3..b90ed7b8e 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -639,6 +639,22 @@ tracking_protection 2020-03-01 + + sign_out + event + A user pressed the sign out button on the sync account page and was successfully signed out of FxA + link + + 2020-03-01 + + + sign_up + event + A user signed up for a new FxA account + link + + 2020-03-01 + scan_pairing event