feat(glean): Add entrypoint variation and experiment to glean metrics

This commit is contained in:
Vijay Budhram 2024-08-02 12:27:40 -04:00
Родитель 264a140026
Коммит ea92c29bcb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9778545895B2532B
54 изменённых файлов: 436 добавлений и 58 удалений

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';
@ -56,6 +56,118 @@ export const appleUnlinkSubmitConfirm = new EventMetricType(
['reason']
);
/**
* User clicks on Firefox Browser for Desktop in the bento menu
*
* Generated from `account_pref.bento_firefox_desktop`.
*/
export const bentoFirefoxDesktop = new EventMetricType(
{
category: 'account_pref',
name: 'bento_firefox_desktop',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on Firefox Browser for Mobile in the bento menu
*
* Generated from `account_pref.bento_firefox_mobile`.
*/
export const bentoFirefoxMobile = new EventMetricType(
{
category: 'account_pref',
name: 'bento_firefox_mobile',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on Mozilla Monitor in the bento menu
*
* Generated from `account_pref.bento_monitor`.
*/
export const bentoMonitor = new EventMetricType(
{
category: 'account_pref',
name: 'bento_monitor',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on Pocket in the bento menu
*
* Generated from `account_pref.bento_pocket`.
*/
export const bentoPocket = new EventMetricType(
{
category: 'account_pref',
name: 'bento_pocket',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on Firefox Relay in the bento menu
*
* Generated from `account_pref.bento_relay`.
*/
export const bentoRelay = new EventMetricType(
{
category: 'account_pref',
name: 'bento_relay',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on the bento menu at the top of the account settings page
*
* Generated from `account_pref.bento_view`.
*/
export const bentoView = new EventMetricType(
{
category: 'account_pref',
name: 'bento_view',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on Mozilla VPN in the bento menu
*
* Generated from `account_pref.bento_vpn`.
*/
export const bentoVpn = new EventMetricType(
{
category: 'account_pref',
name: 'bento_vpn',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* Click on "Change" on account settings page to change password for account
*
@ -155,6 +267,56 @@ export const googleUnlinkSubmitConfirm = new EventMetricType(
['reason']
);
/**
* User clicked the question mark icon "Help" link in the account settings page
* header
*
* Generated from `account_pref.help`.
*/
export const help = new EventMetricType(
{
category: 'account_pref',
name: 'help',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicks on the Get free scan link on the new Monitor promotion in the
* account settings side panel
*
* Generated from `account_pref.promo_monitor_submit`.
*/
export const promoMonitorSubmit = new EventMetricType(
{
category: 'account_pref',
name: 'promo_monitor_submit',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
['reason']
);
/**
* User sees the Monitor promo on their settings page.
*
* Generated from `account_pref.promo_monitor_view`.
*/
export const promoMonitorView = new EventMetricType(
{
category: 'account_pref',
name: 'promo_monitor_view',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
['reason']
);
/**
* Click on "Create" or "Change" button on account settings page to add a recovery
* key to the account
@ -188,6 +350,39 @@ export const secondaryEmailSubmit = new EventMetricType(
[]
);
/**
* User started the 2FA setup process by viewing step 1 of the funnel, complete
* with QR code for scanning.
*
* Generated from `account_pref.two_step_auth_qr_view`.
*/
export const twoStepAuthQrView = new EventMetricType(
{
category: 'account_pref',
name: 'two_step_auth_qr_view',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* User clicked the "Can't scan code?" link
*
* Generated from `account_pref.two_step_auth_scan_code_link`.
*/
export const twoStepAuthScanCodeLink = new EventMetricType(
{
category: 'account_pref',
name: 'two_step_auth_scan_code_link',
sendInPings: ['events'],
lifetime: 'ping',
disabled: false,
},
[]
);
/**
* Click on "Add" button on account settings page for adding 2FA to account
*

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';
@ -70,5 +70,5 @@ export const view = new EventMetricType(
lifetime: 'ping',
disabled: false,
},
[]
['third_party_links']
);

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -0,0 +1,35 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';
/**
* The entrypoint experiment the user was assigned to. This value is specified
* by query parameter `entrypoint_experiment` in the URL.
*
* Generated from `entrypoint.experiment`.
*/
export const experiment = new StringMetricType({
category: 'entrypoint',
name: 'experiment',
sendInPings: ['accounts-events', 'events'],
lifetime: 'application',
disabled: false,
});
/**
* The entrypoint variation the user was assigned to. This value is specified
* by query parameter `entrypoint_variation` in the URL.
*
* Generated from `entrypoint.variation`.
*/
export const variation = new StringMetricType({
category: 'entrypoint',
name: 'variation',
sendInPings: ['accounts-events', 'events'],
lifetime: 'application',
disabled: false,
});

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

@ -2,8 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';
import StringMetricType from '@mozilla/glean/private/metrics/string';
/**
@ -31,3 +32,17 @@ export const reason = new StringMetricType({
lifetime: 'ping',
disabled: false,
});
/**
* boolean, additional context-dependent (on event.name) info related to third
* party auth links
*
* Generated from `event.third_party_links`.
*/
export const thirdPartyLinks = new BooleanMetricType({
category: 'event',
name: 'third_party_links',
sendInPings: ['accounts-events'],
lifetime: 'ping',
disabled: false,
});

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

@ -23,6 +23,7 @@ import { deviceType, entrypoint, flowId } from './session';
import * as thirdPartyAuth from './thirdPartyAuth';
import * as thirdPartyAuthSetPassword from './thirdPartyAuthSetPassword';
import * as utm from './utm';
import * as entrypointQuery from './entrypoint';
export type GleanMetricsConfig = {
enabled: boolean;
@ -116,6 +117,9 @@ const populateMetrics = async (properties: EventProperties = {}) => {
utm.medium.set(flowEventMetadata.utmMedium || '');
utm.source.set(flowEventMetadata.utmSource || '');
utm.term.set(flowEventMetadata.utmTerm || '');
entrypointQuery.experiment.set(flowEventMetadata.entrypointExperiment || '');
entrypointQuery.variation.set(flowEventMetadata.entrypointVariation || '');
};
const recordEventMetric = (eventName: string, properties: EventProperties) => {

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';
@ -287,5 +287,5 @@ export const view = new EventMetricType(
lifetime: 'ping',
disabled: false,
},
[]
['third_party_links']
);

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import PingType from '@mozilla/glean/private/ping';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import LabeledMetricType from '@mozilla/glean/private/metrics/labeled';
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import LabeledMetricType from '@mozilla/glean/private/metrics/labeled';
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -18,6 +18,7 @@ import {
flowId,
} from '../../../scripts/lib/glean/session';
import * as utm from '../../../scripts/lib/glean/utm';
import * as entrypointQuery from '../../../scripts/lib/glean/entrypoint';
import sinon from 'sinon';
import { assert } from 'chai';
@ -71,6 +72,8 @@ describe('lib/glean', () => {
setUtmMediumStub,
setUtmSourceStub,
setUtmTermStub,
setEntryExperimentStub,
setEntryVariationStub,
submitPingStub;
beforeEach(async () => {
@ -87,6 +90,8 @@ describe('lib/glean', () => {
setUtmMediumStub = sandbox.stub(utm.medium, 'set');
setUtmSourceStub = sandbox.stub(utm.source, 'set');
setUtmTermStub = sandbox.stub(utm.term, 'set');
setEntryExperimentStub = sandbox.stub(entrypointQuery.experiment, 'set');
setEntryVariationStub = sandbox.stub(entrypointQuery.variation, 'set');
submitPingStub = sandbox.stub(pings.accountsEvents, 'submit');
await testResetGlean('glean-test');
});
@ -128,6 +133,9 @@ describe('lib/glean', () => {
sinon.assert.notCalled(setUtmMediumStub);
sinon.assert.notCalled(setUtmSourceStub);
sinon.assert.notCalled(setUtmTermStub);
sinon.assert.notCalled(setEntryVariationStub);
sinon.assert.notCalled(setEntryExperimentStub);
});
});
@ -196,6 +204,9 @@ describe('lib/glean', () => {
sinon.assert.calledWith(setUtmMediumStub, '');
sinon.assert.calledWith(setUtmSourceStub, '');
sinon.assert.calledWith(setUtmTermStub, '');
sinon.assert.calledWith(setEntryExperimentStub, '');
sinon.assert.calledWith(setEntryVariationStub, '');
});
it('sets the metrics values', async () => {
@ -207,6 +218,8 @@ describe('lib/glean', () => {
utmMedium: 'buzz',
utmSource: 'newtab',
utmTerm: 'wibble',
entrypointExperiment: 'on',
entrypointVariation: 'earth',
};
mockClientId = '133t';
mockService = 'fortress';
@ -241,6 +254,15 @@ describe('lib/glean', () => {
mockFlowEventMetadata.utmSource
);
sinon.assert.calledWith(setUtmTermStub, mockFlowEventMetadata.utmTerm);
sinon.assert.calledWith(
setEntryExperimentStub,
mockFlowEventMetadata.entrypointExperiment
);
sinon.assert.calledWith(
setEntryVariationStub,
mockFlowEventMetadata.entrypointVariation
);
});
it('submits the pings in order', async () => {

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.3.0. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
// This requires `uuid` and `mozlog` libraries to be in the environment
const uuidv4 = require('uuid').v4;
@ -105,7 +105,7 @@ class AccountsEventsServerEvent {
},
// `Unknown` fields below are required in the Glean schema, however they are not useful in server context
client_info: {
telemetry_sdk_build: 'glean_parser v14.3.0',
telemetry_sdk_build: 'glean_parser v14.5.2',
first_run_date: 'Unknown',
os: 'Unknown',
os_version: 'Unknown',
@ -201,7 +201,7 @@ class EventsServerEventLogger {
},
// `Unknown` fields below are required in the Glean schema, however they are not useful in server context
client_info: {
telemetry_sdk_build: 'glean_parser v14.3.0',
telemetry_sdk_build: 'glean_parser v14.5.2',
first_run_date: 'Unknown',
os: 'Unknown',
os_version: 'Unknown',
@ -334,7 +334,7 @@ class EventsServerEventLogger {
category: 'access_token',
name: 'created',
extra: {
reason: reason,
reason: String(reason),
},
};
this.#record({
@ -773,7 +773,7 @@ class EventsServerEventLogger {
category: 'login',
name: 'submit_backend_error',
extra: {
reason: reason,
reason: String(reason),
},
};
this.#record({
@ -1646,7 +1646,7 @@ class EventsServerEventLogger {
category: 'reg',
name: 'submit_error',
extra: {
reason: reason,
reason: String(reason),
},
};
this.#record({
@ -1713,7 +1713,7 @@ class EventsServerEventLogger {
category: 'relying_party',
name: 'form_view',
extra: {
type: type,
type: String(type),
},
};
this.#record({
@ -1780,7 +1780,7 @@ class EventsServerEventLogger {
category: 'third_party_auth',
name: 'apple_login_complete',
extra: {
linking: linking,
linking: String(linking),
},
};
this.#record({
@ -1909,7 +1909,7 @@ class EventsServerEventLogger {
category: 'third_party_auth',
name: 'google_login_complete',
extra: {
linking: linking,
linking: String(linking),
},
};
this.#record({

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

@ -26,6 +26,7 @@ import {
flowId,
} from 'fxa-shared/metrics/glean/web/session';
import * as utm from 'fxa-shared/metrics/glean/web/utm';
import * as entrypointQuery from 'fxa-shared/metrics/glean/web/entrypoint';
import { Config } from '../config';
import { WebIntegration, useAccount } from '../../models';
@ -73,6 +74,8 @@ describe('lib/glean', () => {
setUtmMediumStub: SinonStub,
setUtmSourceStub: SinonStub,
setUtmTermStub: SinonStub,
setEntrypointExperimentStub: SinonStub,
setEntrypointVariationStub: SinonStub,
pageLoadStub: SinonStub;
beforeEach(async () => {
@ -90,6 +93,8 @@ describe('lib/glean', () => {
utmMedium: 'TV',
utmSource: 'mystery',
utmTerm: 'thunk',
entrypointExperiment: 'on',
entrypointVariation: 'earth',
};
setDeviceTypeStub = sandbox.stub(deviceType, 'set');
@ -105,6 +110,11 @@ describe('lib/glean', () => {
setUtmMediumStub = sandbox.stub(utm.medium, 'set');
setUtmSourceStub = sandbox.stub(utm.source, 'set');
setUtmTermStub = sandbox.stub(utm.term, 'set');
setEntrypointExperimentStub = sandbox.stub(
entrypointQuery.experiment,
'set'
);
setEntrypointVariationStub = sandbox.stub(entrypointQuery.variation, 'set');
submitPingStub = sandbox.stub(pings.accountsEvents, 'submit');
pageLoadStub = sandbox.stub(GleanMetricsAPI.default, 'pageLoad');
@ -145,6 +155,8 @@ describe('lib/glean', () => {
sinon.assert.notCalled(setUtmMediumStub);
sinon.assert.notCalled(setUtmSourceStub);
sinon.assert.notCalled(setUtmTermStub);
sinon.assert.notCalled(setEntrypointExperimentStub);
sinon.assert.notCalled(setEntrypointVariationStub);
});
});
@ -218,6 +230,8 @@ describe('lib/glean', () => {
sinon.assert.calledWith(setUtmMediumStub, '');
sinon.assert.calledWith(setUtmSourceStub, '');
sinon.assert.calledWith(setUtmTermStub, '');
sinon.assert.calledWith(setEntrypointExperimentStub, '');
sinon.assert.calledWith(setEntrypointVariationStub, '');
});
it('sets the metrics values', async () => {
@ -251,6 +265,14 @@ describe('lib/glean', () => {
sinon.assert.calledWith(setUtmMediumStub, mockIntegration.data.utmMedium);
sinon.assert.calledWith(setUtmSourceStub, mockIntegration.data.utmSource);
sinon.assert.calledWith(setUtmTermStub, mockIntegration.data.utmTerm);
sinon.assert.calledWith(
setEntrypointVariationStub,
mockIntegration.data.entrypointVariation
);
sinon.assert.calledWith(
setEntrypointExperimentStub,
mockIntegration.data.entrypointExperiment
);
});
it('submits the pings in order', async () => {

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

@ -42,6 +42,7 @@ import {
import * as sync from 'fxa-shared/metrics/glean/web/sync';
import * as standard from 'fxa-shared/metrics/glean/web/standard';
import * as utm from 'fxa-shared/metrics/glean/web/utm';
import * as entrypointQuery from 'fxa-shared/metrics/glean/web/entrypoint';
import { Integration } from '../../models';
import { MetricsFlow } from '../metrics-flow';
@ -174,6 +175,13 @@ const populateMetrics = async (gleanPingMetrics: GleanPingMetrics) => {
utm.medium.set(metricsContext.integration.data.utmMedium || '');
utm.source.set(metricsContext.integration.data.utmSource || '');
utm.term.set(metricsContext.integration.data.utmTerm || '');
entrypointQuery.variation.set(
metricsContext.integration.data.entrypointVariation || ''
);
entrypointQuery.experiment.set(
metricsContext.integration.data.entrypointExperiment || ''
);
};
const recordEventMetric = (

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

@ -355,6 +355,48 @@ utm:
data_sensitivity:
- interaction
entrypoint:
experiment:
description: |
The entrypoint experiment the user was assigned to. This value is specified
by query parameter `entrypoint_experiment` in the URL.
type: string
lifetime: application
send_in_pings:
- accounts-events
- events
notification_emails:
- vzare@mozilla.com
- fxa-staff@mozilla.com
bugs:
- https://mozilla-hub.atlassian.net/browse/FXA-9847
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1830504
- https://bugzilla.mozilla.org/show_bug.cgi?id=1844121
expires: never
data_sensitivity:
- interaction
variation:
description: |
The entrypoint variation the user was assigned to. This value is specified
by query parameter `entrypoint_variation` in the URL.
type: string
lifetime: application
send_in_pings:
- accounts-events
- events
notification_emails:
- vzare@mozilla.com
- fxa-staff@mozilla.com
bugs:
- https://mozilla-hub.atlassian.net/browse/FXA-9847
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1830504
- https://bugzilla.mozilla.org/show_bug.cgi?id=1844121
expires: never
data_sensitivity:
- interaction
cached_login:
submit:
type: event

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -0,0 +1,35 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';
/**
* The entrypoint experiment the user was assigned to. This value is specified
* by query parameter `entrypoint_experiment` in the URL.
*
* Generated from `entrypoint.experiment`.
*/
export const experiment = new StringMetricType({
category: 'entrypoint',
name: 'experiment',
sendInPings: ['accounts-events', 'events'],
lifetime: 'application',
disabled: false,
});
/**
* The entrypoint variation the user was assigned to. This value is specified
* by query parameter `entrypoint_variation` in the URL.
*
* Generated from `entrypoint.variation`.
*/
export const variation = new StringMetricType({
category: 'entrypoint',
name: 'variation',
sendInPings: ['accounts-events', 'events'],
lifetime: 'application',
disabled: false,
});

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

@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';
import StringMetricType from '@mozilla/glean/private/metrics/string';
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';
/**
* The name of the event

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import PingType from '@mozilla/glean/private/ping';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import LabeledMetricType from '@mozilla/glean/private/metrics/labeled';
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import LabeledMetricType from '@mozilla/glean/private/metrics/labeled';
import BooleanMetricType from '@mozilla/glean/private/metrics/boolean';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import EventMetricType from '@mozilla/glean/private/metrics/event';

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

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// AUTOGENERATED BY glean_parser v14.5.1. DO NOT EDIT. DO NOT COMMIT.
// AUTOGENERATED BY glean_parser v14.5.2. DO NOT EDIT. DO NOT COMMIT.
import StringMetricType from '@mozilla/glean/private/metrics/string';