Skip to content

Commit

Permalink
For mozilla-mobile#18855 [Telemetry] Send an event when users open th…
Browse files Browse the repository at this point in the history
…e toolbar menu
  • Loading branch information
Amejia481 committed Apr 14, 2021
1 parent b98b4b0 commit c531d45
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
13 changes: 13 additions & 0 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,19 @@ events:
notification_emails:
- fenix-core@mozilla.com
expires: "2021-10-01"
toolbar_menu_visible:
type: event
description: |
The browser menu was displayed from toolbar menu
bugs:
- https://github.com/mozilla-mobile/fenix/issues/18855
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/18895
data_sensitivity:
- interaction
notification_emails:
- fenix-core@mozilla.com
expires: "2021-10-01"
total_uri_count:
type: counter
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ sealed class Event {
object OpenedTabSuggestionClicked : Event()

object SetDefaultBrowserToolbarMenuClicked : Event()

object ToolbarMenuShown : Event()
// Interaction events with extras

data class TopSiteSwipeCarousel(val page: Int) : Event() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ private val Event.wrapper: EventWrapper<*>?
is Event.SetDefaultBrowserToolbarMenuClicked -> EventWrapper<NoExtraKeys>(
{ ExperimentsDefaultBrowser.toolbarMenuClicked.record(it) }
)
is Event.ToolbarMenuShown -> EventWrapper<NoExtraKeys>(
{ Events.toolbarMenuVisible.record(it) }
)
is Event.ChangedToDefaultBrowser -> EventWrapper<NoExtraKeys>(
{ Events.defaultBrowserChanged.record(it) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ internal class ReleaseMetricController(
}

Component.BROWSER_TOOLBAR to ToolbarFacts.Items.MENU -> {
metadata?.get("customTab")?.let { Event.CustomTabsMenuOpened }
metadata?.get("customTab")?.let { Event.CustomTabsMenuOpened } ?: Event.ToolbarMenuShown
}
Component.BROWSER_MENU to BrowserMenuFacts.Items.WEB_EXTENSION_MENU_ITEM -> {
metadata?.get("id")?.let { Event.AddonsOpenInToolbarMenu(it.toString()) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ open class DefaultToolbarMenu(
}
}
private fun getSetDefaultBrowserItem(): BrowserMenuImageText? {
val experiments = context.components.analytics.experiments
val analytics = context.components.analytics
val experiments = analytics.experiments
val browsers = BrowsersCache.all(context)

return experiments.withExperiment(Experiments.DEFAULT_BROWSER) { experimentBranch ->
Expand Down
1 change: 1 addition & 0 deletions docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ In addition to those built-in metrics, the following metrics are added to the pi
| events.set_default_browser_experiment |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Indicates which branch let to user to set Firefox as a default browser |[mozilla-mobile/fenix#18895](https://github.com/mozilla-mobile/fenix/pull/18895)|<ul><li>item: A string containing the experiment that let users to set their default browser to Firefox. These items include ToolbarMenu, SettingMenu and NewTabBanner </li></ul>|2021-10-01 |2 |
| events.synced_tab_opened |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |An event that indicates that a synced tab was opened. |[mozilla-mobile/fenix#16727](https://github.com/mozilla-mobile/fenix/pull/16727)||2021-05-10 |2 |
| events.tab_counter_menu_action |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A tab counter menu item was tapped |[mozilla-mobile/fenix#11533](https://github.com/mozilla-mobile/fenix/pull/11533), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#18143](https://github.com/mozilla-mobile/fenix/pull/18143)|<ul><li>item: A string containing the name of the item the user tapped. These items are: New tab, New private tab, Close tab </li></ul>|2021-07-01 |2 |
| events.toolbar_menu_visible |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |The browser menu was displayed from toolbar menu |[mozilla-mobile/fenix#18895](https://github.com/mozilla-mobile/fenix/pull/18895)||2021-10-01 |2 |
| events.whats_new_tapped |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user opened the "what's new" page button |[mozilla-mobile/fenix#5090](https://github.com/mozilla-mobile/fenix/pull/5090), [mozilla-mobile/fenix#13958](https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877), [mozilla-mobile/fenix#18143](https://github.com/mozilla-mobile/fenix/pull/18143)||2021-07-01 |2 |
| experiments_default_browser.toolbar_menu_clicked |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |Set default browser was clicked from toolbar menu |[mozilla-mobile/fenix#18895](https://github.com/mozilla-mobile/fenix/pull/18895)||2021-10-01 |2 |
| find_in_page.closed |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A user closed the find in page UI |[mozilla-mobile/fenix#1344](https://github.com/mozilla-mobile/fenix/pull/1344#issuecomment-479285010), [mozilla-mobile/fenix#15713](https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068)||2021-08-01 |2 |
Expand Down

0 comments on commit c531d45

Please sign in to comment.