Bug 1685734 - Add telemetry for tab-to-search result impressions. r=mak

Differential Revision: https://phabricator.services.mozilla.com/D103075
This commit is contained in:
harry 2021-02-04 19:53:40 +00:00
Родитель 2d0b656483
Коммит bbeee51ee1
3 изменённых файлов: 52 добавлений и 49 удалений

Просмотреть файл

@ -288,8 +288,13 @@ class ProviderTabToSearch extends UrlbarProvider {
);
}
// We also record in urlbar.tips because only it has been approved for use
// We also record in urlbar.tips because only it has been approved for use
// in release channels.
Services.telemetry.keyedScalarAdd(
"urlbar.tips",
"tabtosearch-shown",
this.enginesShown.regular.size
);
Services.telemetry.keyedScalarAdd(
"urlbar.tips",
"tabtosearch_onboard-shown",

Просмотреть файл

@ -102,6 +102,15 @@ urlbar.tips
Incremented when the user picks the update_web search intervention.
- ``intervention_update_web-shown``
Incremented when the update_web search intervention is shown.
- ``tabtosearch-shown``
Increment when a non-onboarding tab-to-search result is shown, once per
engine per engagement. Please note that the number of times non-onboarding
tab-to-search results are picked is the sum of all keys in
``urlbar.searchmode.tabtosearch``. Please also note that more detailed
telemetry is recorded about both onboarding and non-onboarding tab-to-search
results in urlbar.tabtosearch.*. These probes in ``urlbar.tips`` are still
recorded because ``urlbar.tabtosearch.*`` is not currently recorded
in Release.
- ``tabtosearch_onboard-shown``
Incremented when a tab-to-search onboarding result is shown, once per engine
per engagement. Please note that the number of times tab-to-search

Просмотреть файл

@ -205,6 +205,7 @@ add_task(async function onboarding_impressions() {
});
await impressions_test(true);
await SpecialPowers.popPrefEnv();
delete UrlbarProviderTabToSearch.onboardingInteractionAtTime;
});
async function impressions_test(isOnboarding) {
@ -240,14 +241,12 @@ async function impressions_test(isOnboarding) {
await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur());
let scalars = TelemetryTestUtils.getProcessScalars("parent", true);
if (isOnboarding) {
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
"tabtosearch_onboard-shown",
1
);
}
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
isOnboarding ? "tabtosearch_onboard-shown" : "tabtosearch-shown",
1
);
TelemetryTestUtils.assertKeyedScalar(
scalars,
isOnboarding
@ -276,14 +275,12 @@ async function impressions_test(isOnboarding) {
// different onboarding result and now we increment
// tabtosearch_onboard-shown.
scalars = TelemetryTestUtils.getProcessScalars("parent", true);
if (isOnboarding) {
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
"tabtosearch_onboard-shown",
3
);
}
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
isOnboarding ? "tabtosearch_onboard-shown" : "tabtosearch-shown",
3
);
TelemetryTestUtils.assertKeyedScalar(
scalars,
isOnboarding
@ -318,14 +315,12 @@ async function impressions_test(isOnboarding) {
await checkForTabToSearchResult(`${ENGINE_NAME}2`, isOnboarding);
await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur());
scalars = TelemetryTestUtils.getProcessScalars("parent", true);
if (isOnboarding) {
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
"tabtosearch_onboard-shown",
4
);
}
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
isOnboarding ? "tabtosearch_onboard-shown" : "tabtosearch-shown",
4
);
TelemetryTestUtils.assertKeyedScalar(
scalars,
isOnboarding
@ -364,14 +359,12 @@ async function impressions_test(isOnboarding) {
await checkForTabToSearchResult(`${ENGINE_NAME}2`, isOnboarding);
await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur());
scalars = TelemetryTestUtils.getProcessScalars("parent", true);
if (isOnboarding) {
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
"tabtosearch_onboard-shown",
5
);
}
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
isOnboarding ? "tabtosearch_onboard-shown" : "tabtosearch-shown",
5
);
TelemetryTestUtils.assertKeyedScalar(
scalars,
isOnboarding
@ -391,14 +384,12 @@ async function impressions_test(isOnboarding) {
await checkForTabToSearchResult(`${ENGINE_NAME}2`, isOnboarding);
await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur());
scalars = TelemetryTestUtils.getProcessScalars("parent", true);
if (isOnboarding) {
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
"tabtosearch_onboard-shown",
6
);
}
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
isOnboarding ? "tabtosearch_onboard-shown" : "tabtosearch-shown",
6
);
TelemetryTestUtils.assertKeyedScalar(
scalars,
isOnboarding
@ -437,14 +428,12 @@ async function impressions_test(isOnboarding) {
await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur());
// We clear the scalar this time.
scalars = TelemetryTestUtils.getProcessScalars("parent", true, true);
if (isOnboarding) {
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
"tabtosearch_onboard-shown",
8
);
}
TelemetryTestUtils.assertKeyedScalar(
scalars,
"urlbar.tips",
isOnboarding ? "tabtosearch_onboard-shown" : "tabtosearch-shown",
8
);
TelemetryTestUtils.assertKeyedScalar(
scalars,
isOnboarding