Commit Graph

55 Commits

Author SHA1 Message Date
Stephen Thompson
b7d69dd476 Bug 1963713 - add tab group ungroup metric event r=dao,tabbrowser-reviewers
Record when a user ungroups the tabs of a tab group.

We ungroup an entire group when the user selects the "Ungroup tabs" context menu item on the tab group, but we also do that if the user cancels out of tab group creation context menu. We are particularly interested in understanding when users cancel out of the creation process. This may give us a better indicator about accidental tab group creation, e.g. when the user intended to drag and drop to move a tab but ended up creating a tab group from two tabs.

Differential Revision: https://phabricator.services.mozilla.com/D247633
2025-05-07 15:05:43 +00:00
Stephen Thompson
37cc744292 Bug 1962434 - raise TabGroupCreate when tab group element mounts r=dao,tabbrowser-reviewers
Session restore code doesn't use the standard Tabbrowser.addTabGroup API, so tab groups that enter the DOM via session restore don't raise any TabGroupCreate events. To be consistent, and in order to support addons that need to have an up-to-date view of the tab strip, this patch fires TabGroupCreate on each tab group that enters the DOM.

This patch renames the existing `TabGroupCreate` fired from Tabbrowser.addTabGroup to `TabGroupCreateByUser`. This new event will fire after the tab group enters the DOM (therefore after `TabGroupCreate`) in scenarios where code calls Tabbrowser.addTabGroup with `isUserTriggered = true` to indicate that a user took an explicit action to create this tab group as a new tab group.

Differential Revision: https://phabricator.services.mozilla.com/D246630
2025-04-29 20:08:49 +00:00
Stephen Thompson
f8fe0335c0 Bug 1938401 - tab group interaction metrics r=dwalker,sessionstore-reviewers,tabbrowser-reviewers
Records counts of user interactions with tab groups:

- expand a collapsed tab group
- collapse an expanded tab group
- rename a tab group
- change a tab group's color
- save and close a tab group
- delete a tab group
- reopen a deleted tab group
- ungroup a tab group
- move a tab group to a new window
- reopen a saved and closed tab group from the list all tabs menu
- reopen a saved and closed tab group from a URL bar suggestion
- reopen a recently closed tab group from the recently closed tabs menu

Differential Revision: https://phabricator.services.mozilla.com/D246123
2025-04-24 02:20:14 +00:00
Jeremy Swinarton
39096a611c Bug 1960360: Tab interaction metrics for dragging tabs out of groups r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D245749
2025-04-17 16:29:29 +00:00
Jeremy Swinarton
4a0e2c38cc Bug 1938405: Tab interaction metrics for tab groups r=dao,sthompson,tabbrowser-reviewers
This patch adds the most basic tab interaction metrics for tab groups.
As discussed in standup, we agreed to move the `remove_` class of
metrics into its own bug due to extra complexity involved in correctly
capturing these events.

One other thing we discussed was what the scope of events should be for
the `close_` class of events, i.e. should we *only* capture an event
when someone clicks the "X" button or closes from the TOM menu, or
should we also account for things like context menus, keyboard
shortcuts, etc.? Originally we agreed to capture _all_ tab close events
and mark any source that was not one of the above mentioned two as
unknown. However, after thinking about this more, I don't believe this
is the right approach. There are many places in the codebase where a tab
is closed but not because a user deliberately did it (e.g. when moving a
tab to a new window — this is actually done by creating a new tab in a
new window and closing the old). We currently don't distinguish between
user-initiated close actions, so it would take some time to find all
these places and exclude them.

I favour an explicit inclusion approach (which is what we are doing
elsewhere). In this patch I added events for:
  - closing a tab from the "X" close button (`close_tabstrip`)
  - closing a tab from the tab context menu (`close_tabstrip`)
  - closing a tab from the TOM (`close_tabmenu`)

There are other places that could potentially be
addressed, so I suggest moving these to a follow-up bug and addressing
them for 139.

Differential Revision: https://phabricator.services.mozilla.com/D244915
2025-04-16 15:01:28 +00:00
Stephen Thompson
8551cfa4aa Bug 1938398 - add saved tab group metrics r=jswinarton,sessionstore-reviewers,tabbrowser-reviewers
- record number of saved tab groups
- record min/max/median/average number of tabs in saved tab groups

This patch adds a new observable topic `sessionstore-saved-tab-groups-changed` to SessionStore. This is emitted when a saved tab group is added or removed from the session. BrowserUsageTelemetry subscribes to that topic and updates saved tab group-related metrics.

BrowserUsageTelemetry is also setting those saved tab group-related metrics on startup. BrowserGlue initializes BrowserUsageTelemetry after the session has been restored/set up, so saved tab group information will be available at that time. This is also important to make sure that we keep this metric correct even if a user doesn't touch their saved tab groups during the course of a session.

Differential Revision: https://phabricator.services.mozilla.com/D245138
2025-04-14 16:01:39 +00:00
Gijs Kruitbosch
e66aa47674 Bug 1958070 - unify scheduling of telemetry-related startup tasks,r=firefox-desktop-core-reviewers ,mossop
This moves a handful of things to run slightly later, but primarily it makes
sure that the scheduling and conditions under which each bit of telemetry is
collected is clear and in one place, instead of spread around.

Differential Revision: https://phabricator.services.mozilla.com/D244421
2025-04-14 14:04:33 +00:00
Stephen Thompson
f2e07044ae Bug 1938424 - metrics event when tabs added to tab group r=dao,jswinarton,tabbrowser-reviewers,extension-reviewers,robwu
When using the tab context menu or drag-dropping tabs to put them into a group, record a metric for the number of tabs added to the group.

Data Science asked us to launch with this metric disabled so that they could control it using server knobs. They expect a high volume of events, so they expect to only enable this metric for some proportion of users.

I converted the existing `TabMove` event derived from `UIEvent` being fired when tabs change their tab index in the tab strip. `UIEvent` doesn't allow for attaching additional context/detail to the event. `TabMove` is now a `CustomEvent` that provides more context about the moved tab and it fires in more cases -- it's possible for the tab index not to change despite the tab having "moved" into/out of a tab group.

This approach would not capture tab movements that occur across multiple frames/event loop iterations.

Differential Revision: https://phabricator.services.mozilla.com/D244616
2025-04-11 13:52:22 +00:00
Florian Quèze
9ec8cc29a6 Bug 1956726 - Migrate histograms to use Glean APIs in browser/, r=chutten,sessionstore-reviewers,tabbrowser-reviewers,mconley,nsharpley.
Differential Revision: https://phabricator.services.mozilla.com/D243706
2025-04-03 17:09:35 +00:00
Stephen Thompson
895511dc6f Bug 1938430 - add delete tab group event r=jswinarton,tabbrowser-reviewers,sessionstore-reviewers
Record when users delete an open group from the tab group context menu or delete an open group from a context menu in the all-tabs menu.

This will not record when users close a window or close all of the individual tabs in a tab group, even though those cases have the logical side effect of deleting a tab group.

Differential Revision: https://phabricator.services.mozilla.com/D241884
2025-04-03 14:12:43 +00:00
Jeremy Swinarton
34d9e59418 Bug 1938426: Record telemetry event when saving a tab group r=dwalker,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D242984
2025-03-27 15:29:19 +00:00
Cosmin Sabou
ced1f3c105 Backed out changeset 68d101b370d8 (bug 1938430) for permafailures on browser_tab_manager_groups.js (Bug 1938697). 2025-03-27 00:21:30 +02:00
Stephen Thompson
78282be03c Bug 1938430 - add delete tab group event r=jswinarton,tabbrowser-reviewers,sessionstore-reviewers
Record when users delete an open group from the tab group context menu or delete an open group from a context menu in the all-tabs menu.

This will not record when users close a window or close all of the individual tabs in a tab group, even though those cases have the logical side effect of deleting a tab group.

Differential Revision: https://phabricator.services.mozilla.com/D241884
2025-03-25 21:16:37 +00:00
Jeremy Swinarton
4bec852b57 Bug 1954500: Fix tab group telemetry to be in line with spec r=sthompson,tabbrowser-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D241830
2025-03-18 20:48:15 +00:00
Jeremy Swinarton
c828d955e5 Bug 1938397: Record active tab group metrics r=dao,tabbrowser-reviewers,sthompson
Differential Revision: https://phabricator.services.mozilla.com/D240196
2025-03-12 17:46:15 +00:00
Mark Banner
878a5d5415 Bug 1951652 - Convert browser/components/search/ modules to use moz-src uris. r=search-reviewers,scunnane
Differential Revision: https://phabricator.services.mozilla.com/D240333
2025-03-05 09:24:37 +00:00
Florian Quèze
72e00a824e Bug 1927093 - Migrate scalars to use Glean APIs for browser.engagement.* (excluding browser.engagement.navigation.*), r=chutten,sessionstore-reviewers,tabbrowser-reviewers,places-reviewers,sfoster.
Differential Revision: https://phabricator.services.mozilla.com/D226371
2024-11-05 13:22:58 +00:00
Florian Quèze
16de1f7828 Bug 1927093 - Remove constants used for scalar names in BrowserUsageTelemetry.sys.mjs, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D226369
2024-10-28 22:02:16 +00:00
Florian Quèze
f2ecff2406 Bug 1927093 - Migrate scalars using scalarSetMaximum to Glean APIs in BrowserUsageTelemetry.sys.mjs, r=chutten,sessionstore-reviewers,sfoster.
Differential Revision: https://phabricator.services.mozilla.com/D226368
2024-10-28 22:02:16 +00:00
Florian Quèze
4d9be8a883 Bug 1923028 - Migrate scalars to use Glean APIs for browser.ui.toolbar_widgets and browser.ui.customized_widgets, r=chutten.
The asserts for key length in TelemetryScalar.cpp are removed to match the previous behavior of silently ignoring these errors. The JS code path didn't have these asserts, but recording through Glean and a telemetry_mirror uses the native code path.

Differential Revision: https://phabricator.services.mozilla.com/D226686
2024-10-24 22:42:11 +00:00
Florian Quèze
3831131e4c Bug 1923028 - Migrate scalars to use Glean APIs for browser.ui.interaction.* probes in BrowserUsageTelemetry.sys.mjs, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D226515
2024-10-24 10:52:57 +00:00
Florian Quèze
f190781cf9 Bug 1923028 - Use GIFFT mirroring for scalars that are already in both Glean and legacy telemetry, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D226370
2024-10-24 10:52:55 +00:00
Chris H-C
724b00c304 Bug 1920562 - Remove JS uses of Services.telemetry.setEventRecordingEnabled r=florian,extension-reviewers,settings-reviewers,pip-reviewers,credential-management-reviewers,search-reviewers,devtools-reviewers,sync-reviewers,sessionstore-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,urlbar-reviewers,sfoster,nchevobbe,valentin,Gijs,dimi,lina,mconley,pdahiya,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D223833
2024-10-08 20:14:42 +00:00
Sandor Molnar
92076e16a7 Backed out 5 changesets (bug 1920562) for causing xpc assertion failures. CLOSED TREE
Backed out changeset 8f085ab589a8 (bug 1920562)
Backed out changeset 4405387ae770 (bug 1920562)
Backed out changeset a68fd13a33ae (bug 1920562)
Backed out changeset cd3672fc08ed (bug 1920562)
Backed out changeset 62ab18879eea (bug 1920562)
2024-10-08 00:16:13 +03:00
Chris H-C
e944bfe7a2 Bug 1920562 - Remove JS uses of Services.telemetry.setEventRecordingEnabled r=florian,settings-reviewers,pip-reviewers,credential-management-reviewers,search-reviewers,devtools-reviewers,sync-reviewers,sessionstore-reviewers,omc-reviewers,migration-reviewers,firefox-desktop-core-reviewers ,urlbar-reviewers,sfoster,nchevobbe,valentin,Gijs,dimi,lina,mconley,pdahiya
Differential Revision: https://phabricator.services.mozilla.com/D223833
2024-10-07 17:29:57 +00:00
Jonathan Sudiaman
5bd5519438 Bug 1899352 - Update BrowserUsageTelemetry for vertical tab events r=sidebar-reviewers,Gijs,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D222962
2024-09-26 02:25:38 +00:00
Florian Quèze
e061accc4d Bug 1918702 - Migrate telemetry events to use Glean APIs for installation.first_seen, r=chutten,nalexander.
Differential Revision: https://phabricator.services.mozilla.com/D222603
2024-09-20 13:58:17 +00:00
Florian Quèze
8aee9b101f Bug 1918702 - Migrate telemetry events to use Glean APIs for pictureinpicture.settings, r=chutten,settings-reviewers,pip-reviewers,firefox-desktop-core-reviewers ,mconley.
Differential Revision: https://phabricator.services.mozilla.com/D222128
2024-09-20 13:58:13 +00:00
Mark Banner
aabcf18c26 Bug 1917530 - Fix some ESLint no-shadow issues in misc code. r=frontend-codestyle-reviewers,perftest-reviewers,translations-reviewers,omc-reviewers,migration-reviewers,webcompat-reviewers,urlbar-reviewers,dao,twisniewski,sparky,mconley,emcminn,mossop
Differential Revision: https://phabricator.services.mozilla.com/D221443
2024-09-12 21:08:44 +00:00
Sandor Molnar
b59809ee6a Backed out 8 changesets (bug 1917532, bug 1575506, bug 1917530) for causing node newtab failures CLOSED TREE
Backed out changeset 8d6f7bc74d08 (bug 1917532)
Backed out changeset 7c963e72cf06 (bug 1575506)
Backed out changeset d5e110187781 (bug 1917530)
Backed out changeset 1d2325ffded6 (bug 1917530)
Backed out changeset 8a361e37e32c (bug 1917530)
Backed out changeset c4011d92c7f7 (bug 1917530)
Backed out changeset 1a45047dfb3c (bug 1917530)
Backed out changeset ed6b35444c45 (bug 1917530)
2024-09-12 20:45:28 +03:00
Mark Banner
e3981e1099 Bug 1917530 - Fix some ESLint no-shadow issues in misc code. r=frontend-codestyle-reviewers,perftest-reviewers,translations-reviewers,omc-reviewers,migration-reviewers,webcompat-reviewers,urlbar-reviewers,dao,twisniewski,sparky,mconley,emcminn,mossop
Differential Revision: https://phabricator.services.mozilla.com/D221443
2024-09-12 16:41:58 +00:00
Chris H-C
d394230f7e Bug 1915851 - Skip recording and testing object metric browser.ui.toolbar_widgets in Artefact Builds r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D220705
2024-08-30 13:53:02 +00:00
Chris H-C
70207b0300 Bug 1913362 - Collect UI widget positions in Glean r=sclements
Differential Revision: https://phabricator.services.mozilla.com/D220300
2024-08-29 14:52:07 +00:00
Daniele Ferla
6de60b0677 Bug 1910505 - Add telemetry probes for PiP auto-trigger feature. r=mconley,settings-reviewers,pip-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218481
2024-08-14 16:23:11 +00:00
Chris H-C
cb42d634d4 Bug 1910976 - Correct browser.usage.interaction to use snake_case extra keys r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D218884
2024-08-09 19:26:33 +00:00
Mark Striemer
5347d38678 Bug 1910623 - Fix Firefox Labs telemetry with moz-checkbox elements r=mconley,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D218103
2024-08-01 21:56:48 +00:00
Gijs Kruitbosch
85ca3fdea4 Bug 1908965 - re-instate telemetry for toggling items in Firefox Labs, r=mstriemer,settings-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D217150
2024-07-22 10:32:34 +00:00
Nipun Shukla
695a45dfe9 Bug 1811374 - Include installation.first_seen event details in new_profile ping, r=chutten,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D176497
2024-05-28 18:17:23 +00:00
acseh
e797b2cc28 Backed out changeset 313662a4f320 (bug 1811374) for causing xpcshell failures on test_new_profile.js CLOSED TREE 2024-05-28 15:27:54 +03:00
Nipun Shukla
c9653252cf Bug 1811374 - Include installation.first_seen event details in new_profile ping, r=chutten,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D176497
2024-05-28 00:45:46 +00:00
Cristian Tuns
a33c03eabe Backed out changeset d07e792e7623 (bug 1811374) for causing xpcshell failures in test_TelemetryController.js CLOSED TREE 2024-05-27 10:48:02 -04:00
Nipun Shukla
2dbba08f14 Bug 1811374 - Include installation.first_seen event details in new_profile ping, r=chutten,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D176497
2024-05-27 13:25:57 +00:00
Chris H-C
8db3818024 Bug 1889111 - Instrument Firefox Desktop UI Interactions with events r=TravisLong,kcochrane,Gijs
Assumption: Browser Usage Telemetry (ideally) records only and all interesting
interactions with Firefox Desktop's UI, and preserving syntax and semantics
when instrumenting using events is valuable.

Value this provides over existing keyed scalars:
* Order of operations (did three tabs open and then three tabs close, or did
  a single tab open-close three times?)
* Flow control (several atomic interactions combine to a user task. flow_id
  grouping allows us to see that easily in analysis. e.g. Open a tab, open
  prefs, privacy prefs, change a setting.)
* Glean

This is aiming for prototype quality and a prototype lifetime, to see if it's
worth investing more than just a week or two into.

Differential Revision: https://phabricator.services.mozilla.com/D207908
2024-05-03 15:19:15 +00:00
Dave Townsend
a0c83bc943 Bug 1864896: Autofix unused function arguments (browser). r=webcompat-reviewers,mconley,fxview-reviewers,desktop-theme-reviewers,omc-reviewers,migration-reviewers,twisniewski,aminomancer,dao,sclements,firefox-desktop-core-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203005
2024-03-19 09:36:35 +00:00
Bojidar Marinov
b0118a001e Bug 1839845 - Try switching to about:settings tab when opening about:preferences. r=Gijs,extension-reviewers,migration-reviewers,mconley,robwu
Differential Revision: https://phabricator.services.mozilla.com/D202735
2024-02-29 10:09:59 +00:00
James Teow
45c16fd91e Bug 1864214 - Observe actions on single page application search engine providers - r=Standard8
updateTrackingSinglePageApp() contains the core logic for when we observe same document loads.
Based on conditions, it may record telemetry (engagement/abandonment), and dispatch events
to the appropriate SearchSERPTelemetry actor.

SearchSERPTelemetryChild had to be modified to allow for manual dispatching of events, especially
unloading event listeners in the case where a user navigates to a non-default search page, like
Images or Shopping.

One complication in observing clicks is we're storing search pages based on the URL at the time
of load, and then looking them up again using the originURL, but it might be different from
the currentURL due to the way single page apps work. So this could cause confusion if multiple SERPs
are open and different from their originURL, hence the usage of recovering the correct state map by
first using the browser object and defaulting back to the originURL if the WeakMap doesn't
contain any of the browser objects.

I also created a mock SPA html file that when given a search query parameter, shows mock results.
The helper file head-spa.js contains a class that navigates the pages in tests.

The tests are broken out into the following:
- When a single search provider is opened in a single tab
- When a single search provider is has multiple tabs open
- When multiple providers are open at the same time
- Event listeners on in-content elements are unloaded properly when navigating away from the page

Differential Revision: https://phabricator.services.mozilla.com/D193320
2024-01-31 12:51:54 +00:00
Stanca Serban
c109e5d34d Backed out changeset 716bfac5741b (bug 1864214) foir causing webrender debug leakcheck failures. CLOSED TREE 2024-01-29 21:41:29 +02:00
James Teow
a461777d68 Bug 1864214 - Observe actions on single page application search engine providers - r=Standard8
updateTrackingSinglePageApp() contains the core logic for when we observe same document loads.
Based on conditions, it may record telemetry (engagement/abandonment), and dispatch events
to the appropriate SearchSERPTelemetry actor.

SearchSERPTelemetryChild had to be modified to allow for manual dispatching of events, especially
unloading event listeners in the case where a user navigates to a non-default search page, like
Images or Shopping.

One complication in observing clicks is we're storing search pages based on the URL at the time
of load, and then looking them up again using the originURL, but it might be different from
the currentURL due to the way single page apps work. So this could cause confusion if multiple SERPs
are open and different from their originURL, hence the usage of recovering the correct state map by
first using the browser object and defaulting back to the originURL if the WeakMap doesn't
contain any of the browser objects.

I also created a mock SPA html file that when given a search query parameter, shows mock results.
The helper file head-spa.js contains a class that navigates the pages in tests.

The tests are broken out into the following:
- When a single search provider is opened in a single tab
- When a single search provider is has multiple tabs open
- When multiple providers are open at the same time
- Event listeners on in-content elements are unloaded properly when navigating away from the page

Differential Revision: https://phabricator.services.mozilla.com/D193320
2024-01-29 15:04:51 +00:00
Robin Steuber
89e64cb3f4 Bug 1855604 - Back out calling of provenance data collection r=nalexander
Backs out Bug 1815023's patch: https://hg.mozilla.org/mozilla-central/rev/e9af7f1b2a01

Depends on D189591

Differential Revision: https://phabricator.services.mozilla.com/D189592
2023-10-03 23:40:24 +00:00
Robin Steuber
e194d9f28b Bug 1855604 - Back out putting provenance attribution in installation.first_seen r=nalexander
Backs out Bug 1821189's patch: https://hg.mozilla.org/mozilla-central/rev/c4f8098f81bb

Differential Revision: https://phabricator.services.mozilla.com/D189591
2023-10-03 23:40:24 +00:00