зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
a7b12d8da1
Коммит
7537024af5
|
@ -1232,8 +1232,10 @@ 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)) {
|
||||
return true;
|
||||
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"],
|
||||
|
|
Загрузка…
Ссылка в новой задаче