Bug 1861676 - Use the new queryParamNames SERP telemetry parameter by default. r=search-reviewers,jteow

Differential Revision: https://phabricator.services.mozilla.com/D191649
This commit is contained in:
Mark Banner 2023-11-03 10:35:04 +00:00
Родитель a7b12d8da1
Коммит 7537024af5
30 изменённых файлов: 46 добавлений и 32 удалений

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

@ -1232,10 +1232,12 @@ export class SearchSERPTelemetryChild extends JSWindowActorChild {
// To check this, we look for the presence of the query parameter
// that contains a search term.
let queries = new URLSearchParams(url.split("#")[0].split("?")[1]);
if (queries.has(provider.queryParamName)) {
for (let queryParamName of provider.queryParamNames) {
if (queries.get(queryParamName)) {
return true;
}
}
}
return false;
}

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

@ -720,7 +720,14 @@ class TelemetryHandler {
// To check this, we look for the presence of the query parameter
// that contains a search term.
let queries = new URLSearchParams(url.split("#")[0].split("?")[1]);
if (!queries.get(searchProviderInfo.queryParamName)) {
let hasQuery = false;
for (let queryParamName of searchProviderInfo.queryParamNames) {
if (queries.get(queryParamName)) {
hasQuery = true;
break;
}
}
if (!hasQuery) {
return null;
}
// Default to organic to simplify things.

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

@ -1,6 +1,11 @@
{
"type": "object",
"required": ["telemetryId", "searchPageRegexp", "queryParamName"],
"required": [
"telemetryId",
"searchPageRegexp",
"queryParamName",
"queryParamNames"
],
"properties": {
"telemetryId": {
"type": "string",

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

@ -36,7 +36,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -25,7 +25,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -12,7 +12,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -27,7 +27,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -23,7 +23,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -12,7 +12,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -14,7 +14,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_searchbox_with_content.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -15,7 +15,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -14,7 +14,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -13,7 +13,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["mozAttr"],

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

@ -15,7 +15,7 @@ const BASE_TEST_PROVIDER = {
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
extraAdServersRegexps: [/^https:\/\/example\.org\/ad/],

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

@ -16,7 +16,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -14,7 +14,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -14,7 +14,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -14,7 +14,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example-data-attributes",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetryAd_dataAttributes(?:_none|_href)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
adServerAttributes: ["xyz"],

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

@ -14,7 +14,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "slow-page-load",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/slow_loading_page_with_ads(_on_load_event)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -12,7 +12,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -12,7 +12,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.org\/browser\/browser\/components\/search\/test\/browser\/telemetry\/searchTelemetry(?:Ad)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],

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

@ -16,7 +16,7 @@ const TEST_PROVIDER_INFO = [
{
telemetryId: "example",
searchPageRegexp: /^https:\/\/www\.example\.com\/search/,
queryParamName: "q",
queryParamNames: ["q"],
codeParamName: "abc",
taggedCodes: ["ff", "tb"],
expectedOrganicCodes: ["baz"],
@ -36,7 +36,7 @@ const TEST_PROVIDER_INFO = [
{
telemetryId: "example2",
searchPageRegexp: /^https:\/\/www\.example2\.com\/search/,
queryParamName: "q",
queryParamNames: ["a", "q"],
codeParamName: "abc",
taggedCodes: ["ff", "tb"],
expectedOrganicCodes: ["baz"],

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

@ -1026,7 +1026,7 @@ add_task(async function test_privateWindow() {
{
telemetryId: "example",
searchPageRegexp: "^https://example\\.com/",
queryParamName: "q",
queryParamNames: ["q"],
},
]);

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

@ -12,7 +12,7 @@ const TEST_PROVIDER_INFO = [
telemetryId: "example",
searchPageRegexp:
/^https:\/\/example.com\/browser\/browser\/components\/search\/test\/browser\/searchTelemetry(?:Ad)?.html/,
queryParamName: "s",
queryParamNames: ["s"],
codeParamName: "abc",
taggedCodes: ["ff"],
followOnParamNames: ["a"],