commit 3577b7a2aad52a9546cce9febe7f4f0273450ec9 parent a54f9321a440fa6eb1efc2f4f02fd90eed839b84 Author: Reem H <42309026+reemhamz@users.noreply.github.com> Date: Tue, 7 Oct 2025 19:42:43 +0000 Bug 1992647 - Add telemetry for 'Detect my location' option in weather menu. r=home-newtab-reviewers,maxx Differential Revision: https://phabricator.services.mozilla.com/D267741 Diffstat:
5 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/browser/components/newtab/metrics.yaml b/browser/components/newtab/metrics.yaml @@ -556,6 +556,24 @@ newtab: send_in_pings: - newtab + weather_detect_location: + type: event + description: > + Recorded when a user selects 'detect my location' from weather context menu + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1992647 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1992647 + data_sensitivity: + - interaction + notification_emails: + - rhamoui@mozilla.com + expires: never + extra_keys: + newtab_visit_id: *newtab_visit_id + send_in_pings: + - newtab + fakespot_dismiss: type: event description: > diff --git a/browser/extensions/newtab/common/Actions.mjs b/browser/extensions/newtab/common/Actions.mjs @@ -217,6 +217,7 @@ for (const type of [ "WALLPAPER_CLICK", "WALLPAPER_REMOVE_UPLOAD", "WALLPAPER_UPLOAD", + "WEATHER_DETECT_LOCATION", "WEATHER_IMPRESSION", "WEATHER_LOAD_ERROR", "WEATHER_LOCATION_DATA_UPDATE", diff --git a/browser/extensions/newtab/content-src/lib/link-menu-options.mjs b/browser/extensions/newtab/content-src/lib/link-menu-options.mjs @@ -336,6 +336,7 @@ export const LinkMenuOptions = { action: ac.AlsoToMain({ type: at.WEATHER_USER_OPT_IN_LOCATION, }), + userEvent: "WEATHER_DETECT_LOCATION", }), ChangeWeatherDisplaySimple: () => ({ id: "newtab-weather-menu-change-weather-display-simple", diff --git a/browser/extensions/newtab/data/content/activity-stream.bundle.js b/browser/extensions/newtab/data/content/activity-stream.bundle.js @@ -290,6 +290,7 @@ for (const type of [ "WALLPAPER_CLICK", "WALLPAPER_REMOVE_UPLOAD", "WALLPAPER_UPLOAD", + "WEATHER_DETECT_LOCATION", "WEATHER_IMPRESSION", "WEATHER_LOAD_ERROR", "WEATHER_LOCATION_DATA_UPDATE", @@ -2053,6 +2054,7 @@ const LinkMenuOptions = { action: actionCreators.AlsoToMain({ type: actionTypes.WEATHER_USER_OPT_IN_LOCATION, }), + userEvent: "WEATHER_DETECT_LOCATION", }), ChangeWeatherDisplaySimple: () => ({ id: "newtab-weather-menu-change-weather-display-simple", diff --git a/browser/extensions/newtab/lib/TelemetryFeed.sys.mjs b/browser/extensions/newtab/lib/TelemetryFeed.sys.mjs @@ -751,6 +751,12 @@ export class TelemetryFeed { }); break; } + case "WEATHER_DETECT_LOCATION": { + Glean.newtab.weatherDetectLocation.record({ + newtab_visit_id: session.session_id, + }); + break; + } } }