diff --git a/app/metrics.yaml b/app/metrics.yaml index c380bee7a9ec..6fed4f774b47 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -360,6 +360,23 @@ events: notification_emails: - fenix-core@mozilla.com expires: "2021-05-10" + copy_url_tapped: + type: event + description: | + An event that indicates that a user has selected + copy option when long pressing on url bar. + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/16827 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/16915 + data_sensitivity: + - interaction + notification_emails: + - fenix-core@mozilla.com + expires: "2021-05-10" + onboarding: fxa_auto_signin: type: event diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt index ed988beae42d..65b9fa7acdc0 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt @@ -187,6 +187,8 @@ sealed class Event { object TabSettingsOpened : Event() + object CopyUrlUsed : Event() + object SyncedTabOpened : Event() object RecentlyClosedTabsOpened : Event() 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 9d0aa8fd9ef8..a3b56e81e0c8 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 @@ -673,6 +673,9 @@ private val Event.wrapper: EventWrapper<*>? { ProgressiveWebApp.background.record(it) }, { ProgressiveWebApp.backgroundKeys.valueOf(it) } ) + is Event.CopyUrlUsed -> EventWrapper( + { Events.copyUrlTapped.record(it) } + ) is Event.SyncedTabOpened -> EventWrapper( { Events.syncedTabOpened.record(it) } diff --git a/app/src/main/java/org/mozilla/fenix/utils/ToolbarPopupWindow.kt b/app/src/main/java/org/mozilla/fenix/utils/ToolbarPopupWindow.kt index af5f9169cfd5..21c56576b772 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/ToolbarPopupWindow.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/ToolbarPopupWindow.kt @@ -20,6 +20,7 @@ import mozilla.components.browser.state.selector.selectedTab import mozilla.components.browser.state.store.BrowserStore import org.mozilla.fenix.R import org.mozilla.fenix.components.FenixSnackbar +import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.components import java.lang.ref.WeakReference @@ -74,6 +75,7 @@ object ToolbarPopupWindow { .setText(context.getString(R.string.browser_toolbar_url_copied_to_clipboard_snackbar)) .show() } + context.components.analytics.metrics.track(Event.CopyUrlUsed) } customView.paste.setOnClickListener {