From 9f5b1bf3a2a2bc0cba3b68a9bb3640514b576773 Mon Sep 17 00:00:00 2001 From: Nan Jiang Date: Tue, 4 Jan 2022 20:19:14 +0000 Subject: [PATCH] Bug 1748348 - Stop sending search_query and matched_keywords for Firefox Suggest impressions r=adw Differential Revision: https://phabricator.services.mozilla.com/D135059 --- .../urlbar/UrlbarProviderQuickSuggest.jsm | 18 ------------------ .../urlbar/docs/firefox-suggest-telemetry.rst | 9 +++++++-- .../quicksuggest/QuickSuggestTestUtils.jsm | 8 -------- .../browser/browser_quicksuggest_telemetry.js | 18 ++---------------- 4 files changed, 9 insertions(+), 44 deletions(-) diff --git a/browser/components/urlbar/UrlbarProviderQuickSuggest.jsm b/browser/components/urlbar/UrlbarProviderQuickSuggest.jsm index d924a86a4629..835d65fa2cab 100644 --- a/browser/components/urlbar/UrlbarProviderQuickSuggest.jsm +++ b/browser/components/urlbar/UrlbarProviderQuickSuggest.jsm @@ -296,36 +296,18 @@ class ProviderQuickSuggest extends UrlbarProvider { let isQuickSuggestLinkClicked = details.selIndex == resultIndex && details.selType !== "help"; let { - qsSuggestion, // The full keyword sponsoredAdvertiser, sponsoredImpressionUrl, sponsoredClickUrl, sponsoredBlockId, - source, requestId, } = result.payload; let scenario = UrlbarPrefs.get("quicksuggest.scenario"); - - // Collect the search query and matched keywords only when the user has - // opted in to data collection and only for remote settings suggestions. - // Otherwise record those fields as undefined. - let matchedKeywords; - let searchQuery; - if ( - UrlbarPrefs.get("quicksuggest.dataCollection.enabled") && - source === QUICK_SUGGEST_SOURCE.REMOTE_SETTINGS - ) { - matchedKeywords = qsSuggestion || details.searchString; - searchQuery = details.searchString; - } - // impression PartnerLinkAttribution.sendContextualServicesPing( { scenario, - search_query: searchQuery, - matched_keywords: matchedKeywords, advertiser: sponsoredAdvertiser, block_id: sponsoredBlockId, position: telemetryResultIndex, diff --git a/browser/components/urlbar/docs/firefox-suggest-telemetry.rst b/browser/components/urlbar/docs/firefox-suggest-telemetry.rst index c7391d9b9da0..768bdb7587ce 100644 --- a/browser/components/urlbar/docs/firefox-suggest-telemetry.rst +++ b/browser/components/urlbar/docs/firefox-suggest-telemetry.rst @@ -455,7 +455,7 @@ The impression ping payload contains the following: used to link to a client_id. :is_clicked: Whether or not the user also clicked the suggestion. -:matched_keywords: +:matched_keywords (**Removed from Firefox 97**): The matched keywords that lead to the suggestion. This is only included when the user has opted in to data collection and the suggestion is provided by remote settings. @@ -469,7 +469,7 @@ The impression ping payload contains the following: suggestions provided by Merino. :scenario: The user's Suggest scenario, either "offline" or "online". -:search_query: +:search_query (**Removed from Firefox 97**): The exact search query typed by the user. This is only included when the user has opted in to data collection and the suggestion is provided by remote settings. @@ -501,12 +501,17 @@ Changelog [Bug 1736117_, 1735976_] - ``request_id`` is added to the payload. [Bug 1736117_] + Firefox 97.0 + - Stop sending ``search_query`` and ``matched_keywords`` in the custom + impression ping for Firefox Suggest. [Bug 1748348_] + .. _1689365: https://bugzilla.mozilla.org/show_bug.cgi?id=1689365 .. _1725492: https://bugzilla.mozilla.org/show_bug.cgi?id=1725492 .. _1728188: https://bugzilla.mozilla.org/show_bug.cgi?id=1728188 .. _1729576: https://bugzilla.mozilla.org/show_bug.cgi?id=1729576 .. _1736117: https://bugzilla.mozilla.org/show_bug.cgi?id=1736117 .. _1735976: https://bugzilla.mozilla.org/show_bug.cgi?id=1735976 +.. _1748348: https://bugzilla.mozilla.org/show_bug.cgi?id=1748348 Nimbus Exposure Event --------------------- diff --git a/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.jsm b/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.jsm index 45dfa529d20f..97c58876f9a2 100644 --- a/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.jsm +++ b/browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.jsm @@ -329,16 +329,12 @@ class QSTestUtils { * * @param {number} index * The expected zero-based index of the quick suggest result. - * @param {string} search_query - * The search string that triggered the quick suggest result. * @param {object} spy * A `sinon.spy` object. See `createTelemetryPingSpy`. * @param {string} [advertiser] * The expected advertiser in the ping. * @param {number} [block_id] * The expected block_id in the ping. - * @param {string} [matched_keywords] - * The expected matched_keywords in the ping. * @param {string} [reporting_url] * The expected reporting_url in the ping. * @param {string} [scenario] @@ -349,8 +345,6 @@ class QSTestUtils { spy, advertiser = "test-advertiser", block_id = 1, - search_query = undefined, - matched_keywords = search_query, reporting_url = "http://impression.reporting.test.com/", scenario = "offline", }) { @@ -367,11 +361,9 @@ class QSTestUtils { let expectedPayload = { advertiser, block_id, - matched_keywords, position: index + 1, reporting_url, scenario, - search_query, }; let actualPayload = {}; for (let key of Object.keys(expectedPayload)) { diff --git a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_telemetry.js b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_telemetry.js index 3849379fc759..2e6386adb404 100644 --- a/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_telemetry.js +++ b/browser/components/urlbar/tests/quicksuggest/browser/browser_quicksuggest_telemetry.js @@ -76,7 +76,6 @@ add_task(async function impression_offline_dataCollectionDisabled() { UrlbarPrefs.set("quicksuggest.dataCollection.enabled", false); await doImpressionTest({ scenario: "offline", - search_query: undefined, }); }); @@ -89,7 +88,6 @@ add_task(async function impression_offline_dataCollectionEnabled() { UrlbarPrefs.set("quicksuggest.dataCollection.enabled", true); await doImpressionTest({ scenario: "offline", - search_query: TEST_SEARCH_STRING, }); }); @@ -104,7 +102,6 @@ add_task(async function impression_online_dataCollectionDisabled() { UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await doImpressionTest({ scenario: "online", - search_query: undefined, }); }); @@ -119,11 +116,10 @@ add_task(async function impression_online_dataCollectionEnabled() { UrlbarPrefs.set("suggest.quicksuggest.sponsored", true); await doImpressionTest({ scenario: "online", - search_query: TEST_SEARCH_STRING, }); }); -async function doImpressionTest({ scenario, search_query }) { +async function doImpressionTest({ scenario }) { await BrowserTestUtils.withNewTab("about:blank", async () => { spy.resetHistory(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ @@ -149,7 +145,6 @@ async function doImpressionTest({ scenario, search_query }) { index, spy, scenario, - search_query, }); QuickSuggestTestUtils.assertNoClickPing(spy); }); @@ -216,7 +211,6 @@ add_task(async function click_keyboard_offline_dataCollectionDisabled() { await doClickTest({ useKeyboard: true, scenario: "offline", - search_query: undefined, }); }); @@ -230,7 +224,6 @@ add_task(async function click_keyboard_offline_dataCollectionEnabled() { await doClickTest({ useKeyboard: true, scenario: "offline", - search_query: TEST_SEARCH_STRING, }); }); @@ -246,7 +239,6 @@ add_task(async function click_keyboard_online_dataCollectionDisabled() { await doClickTest({ useKeyboard: true, scenario: "online", - search_query: undefined, }); }); @@ -262,7 +254,6 @@ add_task(async function click_keyboard_online_dataCollectionEnabled() { await doClickTest({ useKeyboard: true, scenario: "online", - search_query: TEST_SEARCH_STRING, }); }); @@ -276,7 +267,6 @@ add_task(async function click_mouse_offline_dataCollectionDisabled() { await doClickTest({ useKeyboard: false, scenario: "offline", - search_query: undefined, }); }); @@ -290,7 +280,6 @@ add_task(async function click_mouse_offline_dataCollectionEnabled() { await doClickTest({ useKeyboard: false, scenario: "offline", - search_query: TEST_SEARCH_STRING, }); }); @@ -306,7 +295,6 @@ add_task(async function click_mouse_online_dataCollectionDisabled() { await doClickTest({ useKeyboard: false, scenario: "online", - search_query: undefined, }); }); @@ -322,11 +310,10 @@ add_task(async function click_mouse_online_dataCollectionEnabled() { await doClickTest({ useKeyboard: false, scenario: "online", - search_query: TEST_SEARCH_STRING, }); }); -async function doClickTest({ useKeyboard, scenario, search_query }) { +async function doClickTest({ useKeyboard, scenario }) { await BrowserTestUtils.withNewTab("about:blank", async () => { spy.resetHistory(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ @@ -356,7 +343,6 @@ async function doClickTest({ useKeyboard, scenario, search_query }) { index, spy, scenario, - search_query, }); QuickSuggestTestUtils.assertClickPing({ index, spy, scenario }); });