diff --git a/browser/modules/BrowserUsageTelemetry.jsm b/browser/modules/BrowserUsageTelemetry.jsm index 880489121b2d..9044ac5629de 100644 --- a/browser/modules/BrowserUsageTelemetry.jsm +++ b/browser/modules/BrowserUsageTelemetry.jsm @@ -423,7 +423,7 @@ let BrowserUsageTelemetry = { * true if this event was generated by a one-off search. * @param {Boolean} [details.isSuggestion=false] * true if this event was generated by a suggested search. - * @param {Boolean} [details.alias=null] + * @param {String} [details.alias=null] * The search engine alias used in the search, if any. * @param {Object} [details.type=null] * The object describing the event that triggered the search. @@ -459,8 +459,7 @@ let BrowserUsageTelemetry = { if (details.alias && engine.wrappedJSObject._internalAliases.includes(details.alias)) { - let aliasCountId = - [getSearchEngineId(engine), details.alias, source].join("."); + let aliasCountId = getSearchEngineId(engine) + ".alias"; histogram.add(aliasCountId); } } diff --git a/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js b/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js index 8657ce180a6e..b8c9c35e5b3b 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_urlbar.js @@ -181,9 +181,7 @@ add_task(async function test_simpleQuery() { // Make sure SEARCH_COUNTS contains identical values. checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); - checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined); + checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined); // Also check events. let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false); @@ -238,9 +236,7 @@ add_task(async function test_searchAlias() { // Make sure SEARCH_COUNTS contains identical values. checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); - checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined); + checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined); // Also check events. let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false); @@ -281,9 +277,7 @@ add_task(async function test_internalSearchAlias() { await p; checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); - checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", 1); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined); + checkKeyedHistogram(search_hist, "other-MozSearch.alias", 1); info("Search using the other internal search alias."); p = BrowserTestUtils.browserLoaded(tab.linkedBrowser); @@ -292,9 +286,7 @@ add_task(async function test_internalSearchAlias() { await p; checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 2); - checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", 1); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", 1); + checkKeyedHistogram(search_hist, "other-MozSearch.alias", 2); BrowserTestUtils.removeTab(tab); }); @@ -330,9 +322,7 @@ add_task(async function test_oneOff_enter() { // Make sure SEARCH_COUNTS contains identical values. checkKeyedHistogram(search_hist, "other-MozSearch.urlbar", 1); - checkKeyedHistogram(search_hist, "other-MozSearch.mozalias.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasfoo.urlbar", undefined); - checkKeyedHistogram(search_hist, "other-MozSearch.@mozaliasbar.urlbar", undefined); + checkKeyedHistogram(search_hist, "other-MozSearch.alias", undefined); // Also check events. let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, false); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index 0310a32628c5..e5693dc2441f 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -8032,7 +8032,7 @@ "releaseChannelCollection": "opt-out", "alert_emails": ["adw@mozilla.com"], "bug_numbers": [1089670, 1482158, 1499193], - "description": "Records search counts for search access points and in content searches. For search access points in general and for the urlbar when an internal @engine shorcut is not used, the format is: . For the urlbar when an internal @engine shortcut is used, the format is: .<@engine>.urlbar For in content searches, the format is .in-content:[sap|sap-follow-on|organic]:[code|none]" + "description": "Records search counts for search access points and in content searches. For search access points in general and for the urlbar when an internal @engine shorcut is not used, the format is: . For the urlbar when an internal @engine shortcut is used, the format is: .alias For in content searches, the format is .in-content:[sap|sap-follow-on|organic]:[code|none]" }, "SEARCH_RESET_RESULT": { "record_in_processes": ["main", "content"],