packages/fxa-content-server/server/lib/glean/server_events.js (2,523 lines of code) (raw):

/* 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. // This requires `uuid` and `mozlog` libraries to be in the environment const uuidv4 = require('uuid').v4; const mozlog = require('mozlog'); const GLEAN_EVENT_MOZLOG_TYPE = 'glean-server-event'; let _logger; class AccountsEventsServerEvent { /** * Create AccountsEventsServerEvent instance. * * @param {string} applicationId - The application ID. * @param {string} appDisplayVersion - The application display version. * @param {string} channel - The channel. * @param {LoggerOptions} logger_options - The logger options. */ constructor(applicationId, appDisplayVersion, channel, logger_options) { this._applicationId = applicationId; this._appDisplayVersion = appDisplayVersion; this._channel = channel; if (!_logger) { // append '-glean' to `logger_options.app` to avoid collision with other loggers and double logging logger_options.app = logger_options.app + '-glean'; // set the format to `heka` so messages are properly ingested and decoded logger_options.fmt = 'heka'; _logger = mozlog(logger_options)(); } } /** * Record and submit a server event object. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} event_name - The name of the event. * @param {string} event_reason - additional context-dependent (on event.name) info, e.g. the cause of an error. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ record({ user_agent, ip_address, account_user_id, account_user_id_sha256, event_name, event_reason, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const now = new Date(); const timestamp = now.toISOString(); const eventPayload = { metrics: { string: { 'account.user_id': account_user_id, 'account.user_id_sha256': account_user_id_sha256, 'event.name': event_name, 'event.reason': event_reason, 'relying_party.oauth_client_id': relying_party_oauth_client_id, 'relying_party.service': relying_party_service, 'session.device_type': session_device_type, 'session.entrypoint': session_entrypoint, 'session.entrypoint_experiment': session_entrypoint_experiment, 'session.entrypoint_variation': session_entrypoint_variation, 'session.flow_id': session_flow_id, 'utm.campaign': utm_campaign, 'utm.content': utm_content, 'utm.medium': utm_medium, 'utm.source': utm_source, 'utm.term': utm_term, }, }, ping_info: { seq: 0, // this is required, however doesn't seem to be useful in server context start_time: timestamp, end_time: timestamp, }, // `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.5.2', first_run_date: 'Unknown', os: 'Unknown', os_version: 'Unknown', architecture: 'Unknown', app_build: 'Unknown', app_display_version: this._appDisplayVersion, app_channel: this._channel, }, }; const eventPayloadSerialized = JSON.stringify(eventPayload); // This is the message structure that Decoder expects: https://github.com/mozilla/gcp-ingestion/pull/2400 const ping = { document_namespace: this._applicationId, document_type: 'accounts-events', document_version: '1', document_id: uuidv4(), user_agent: user_agent, ip_address: ip_address, payload: eventPayloadSerialized, }; // this is similar to how FxA currently logs with mozlog: https://github.com/mozilla/fxa/blob/4c5c702a7fcbf6f8c6b1f175e9172cdd21471eac/packages/fxa-auth-server/lib/log.js#L289 _logger.info(GLEAN_EVENT_MOZLOG_TYPE, ping); } } class EventsServerEventLogger { /** * Create EventsServerEventLogger instance. * * @param {string} applicationId - The application ID. * @param {string} appDisplayVersion - The application display version. * @param {string} channel - The channel. * @param {LoggerOptions} logger_options - The logger options. */ constructor(applicationId, appDisplayVersion, channel, logger_options) { this._applicationId = applicationId; this._appDisplayVersion = appDisplayVersion; this._channel = channel; if (!_logger) { // append '-glean' to `logger_options.app` to avoid collision with other loggers and double logging logger_options.app = logger_options.app + '-glean'; // set the format to `heka` so messages are properly ingested and decoded logger_options.fmt = 'heka'; _logger = mozlog(logger_options)(); } } #record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }) { const now = new Date(); const timestamp = now.toISOString(); event.timestamp = now.getTime(); const eventPayload = { metrics: { string: { 'account.user_id': account_user_id, 'account.user_id_sha256': account_user_id_sha256, 'relying_party.oauth_client_id': relying_party_oauth_client_id, 'relying_party.service': relying_party_service, 'session.device_type': session_device_type, 'session.entrypoint': session_entrypoint, 'session.entrypoint_experiment': session_entrypoint_experiment, 'session.entrypoint_variation': session_entrypoint_variation, 'session.flow_id': session_flow_id, 'utm.campaign': utm_campaign, 'utm.content': utm_content, 'utm.medium': utm_medium, 'utm.source': utm_source, 'utm.term': utm_term, }, }, events: [event], ping_info: { seq: 0, // this is required, however doesn't seem to be useful in server context start_time: timestamp, end_time: timestamp, }, // `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.5.2', first_run_date: 'Unknown', os: 'Unknown', os_version: 'Unknown', architecture: 'Unknown', app_build: 'Unknown', app_display_version: this._appDisplayVersion, app_channel: this._channel, }, }; const eventPayloadSerialized = JSON.stringify(eventPayload); // This is the message structure that Decoder expects: https://github.com/mozilla/gcp-ingestion/pull/2400 const ping = { document_namespace: this._applicationId, document_type: 'events', document_version: '1', document_id: uuidv4(), user_agent: user_agent, ip_address: ip_address, payload: eventPayloadSerialized, }; // this is similar to how FxA currently logs with mozlog: https://github.com/mozilla/fxa/blob/4c5c702a7fcbf6f8c6b1f175e9172cdd21471eac/packages/fxa-auth-server/lib/log.js#L289 _logger.info(GLEAN_EVENT_MOZLOG_TYPE, ping); } /** * Record and submit a access_token_checked event: * An OAuth access token was verified. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} scopes - The scopes of the access token. */ recordAccessTokenChecked({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, scopes, }) { const event = { category: 'access_token', name: 'checked', extra: { scopes: String(scopes), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a access_token_created event: * An OAuth access token was created. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - additional context-dependent info, e.g. the cause of an error. */ recordAccessTokenCreated({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'access_token', name: 'created', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a account_delete_complete event: * Account successfully deleted * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordAccountDeleteComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'account', name: 'delete_complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a account_delete_task_handled event: * An account was deleted from FxA. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - The reason for the deletion.. */ recordAccountDeleteTaskHandled({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'account', name: 'delete_task_handled', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a account_password_reset event: * Forgot Password Complete Successful completion of the forgot password funnel. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordAccountPasswordReset({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'account', name: 'password_reset', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_deletion_scheduled event: * The cloud task to delete the account was scheduled. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionDeletionScheduled({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'deletion_scheduled', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_deletion_skipped event: * The scheduled deletion of an inactive account was skipped. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - The reason the deletion was skipped.. */ recordInactiveAccountDeletionDeletionSkipped({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'inactive_account_deletion', name: 'deletion_skipped', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_final_email_skipped event: * The final email notification was skipped. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - The reason the email was skipped.. */ recordInactiveAccountDeletionFinalEmailSkipped({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'inactive_account_deletion', name: 'final_email_skipped', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_final_email_task_enqueued event: * The final-email task was successfully added to the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionFinalEmailTaskEnqueued({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'final_email_task_enqueued', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_final_email_task_rejected event: * The final-email task was not added the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} error_code - The error code returned by the Cloud Tasks client.. */ recordInactiveAccountDeletionFinalEmailTaskRejected({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, error_code, }) { const event = { category: 'inactive_account_deletion', name: 'final_email_task_rejected', extra: { error_code: String(error_code), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_final_email_task_request event: * An attempt to insert the final-email task into the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionFinalEmailTaskRequest({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'final_email_task_request', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_first_email_skipped event: * The first email notification was skipped. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - The reason the email was skipped.. */ recordInactiveAccountDeletionFirstEmailSkipped({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'inactive_account_deletion', name: 'first_email_skipped', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_first_email_task_enqueued event: * The first-email task was successfully added to the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionFirstEmailTaskEnqueued({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'first_email_task_enqueued', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_first_email_task_rejected event: * The first-email task was not added the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} error_code - The error code returned by the Cloud Tasks client.. */ recordInactiveAccountDeletionFirstEmailTaskRejected({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, error_code, }) { const event = { category: 'inactive_account_deletion', name: 'first_email_task_rejected', extra: { error_code: String(error_code), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_first_email_task_request event: * An attempt to insert the first-email task into the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionFirstEmailTaskRequest({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'first_email_task_request', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_second_email_skipped event: * The second email notification was skipped. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - The reason the email was skipped.. */ recordInactiveAccountDeletionSecondEmailSkipped({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'inactive_account_deletion', name: 'second_email_skipped', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_second_email_task_enqueued event: * The second-email task was successfully added to the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionSecondEmailTaskEnqueued({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'second_email_task_enqueued', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_second_email_task_rejected event: * The second-email task was not added the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} error_code - The error code returned by the Cloud Tasks client.. */ recordInactiveAccountDeletionSecondEmailTaskRejected({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, error_code, }) { const event = { category: 'inactive_account_deletion', name: 'second_email_task_rejected', extra: { error_code: String(error_code), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_second_email_task_request event: * An attempt to insert the second-email task into the cloud task queue. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionSecondEmailTaskRequest({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'second_email_task_request', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a inactive_account_deletion_status_checked event: * The active status of an account was checked. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordInactiveAccountDeletionStatusChecked({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'inactive_account_deletion', name: 'status_checked', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_backup_code_success event: * Login Backup Code Success Event that indicates the user successfully authenticated via backup codes. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginBackupCodeSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'backup_code_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_complete event: * Login Complete Event that indicates the login process is complete. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_email_confirmation_sent event: * Login Email Sent Event that indicates an email was sent to confirm email. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginEmailConfirmationSent({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'email_confirmation_sent', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_email_confirmation_success event: * Login Email Confirmed (BE) Event that indicates a user successfully confirmed their email for the login flow by entering the code sent in the confirmation email. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginEmailConfirmationSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'email_confirmation_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_submit_backend_error event: * Login Submission Failure (Server) Event that indicates an attempt to login by clicking "Sign in" on the login page was not successful. Ideally we would have additional data on why the login failed. We might expect most reasons to be "Incorrect password". * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - additional context-dependent info, e.g. the cause of an error. */ recordLoginSubmitBackendError({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'login', name: 'submit_backend_error', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_success event: * Login Submission Success Event that indicates an attempt to login by clicking "Sign in" on the login page was successful. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_totp_code_failure event: * The user failed to enter a correct TOTP for 2FA. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginTotpCodeFailure({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'totp_code_failure', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a login_totp_code_success event: * Login 2FA Success (BE) Event that indicates a user successfully authenticated via 2FA. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordLoginTotpCodeSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'login', name: 'totp_code_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_create_new_success event: * Create New Password Success (BE) A new password was successfully created' * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetCreateNewSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'create_new_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_email_confirmation_sent event: * One-Time-Password to initiate the password reset process sent to the FxA email address * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetEmailConfirmationSent({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'email_confirmation_sent', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_email_confirmation_success event: * One-Time-Password to initiate the password reset process was successfully verified * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetEmailConfirmationSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'email_confirmation_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_email_sent event: * Forgot Password Email Link Sent Link to reset password sent to the FxA email address' * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetEmailSent({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'email_sent', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_recovery_code_success event: * User successfully verified their recovery code before password reset * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetRecoveryCodeSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'recovery_code_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_recovery_key_create_success event: * Forgot Password w/ Recovery Key Create New Password Success (BE) User successfully submits the form to create a new password' * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetRecoveryKeyCreateSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'recovery_key_create_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_recovery_key_success event: * Forgot Password Confirm Recovery Key Success Successful recovery key input for the forgot password flow' * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetRecoveryKeySuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'recovery_key_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a password_reset_two_factor_success event: * User successfully verified their two factor authentication code before password reset * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordPasswordResetTwoFactorSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'password_reset', name: 'two_factor_success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a reg_acc_created event: * Registration Submission Success Event that indicates registration was successful. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordRegAccCreated({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'reg', name: 'acc_created', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a reg_acc_verified event: * Registration Email Confirmed Event that indicates a user successfully entered and submitted the email confirmation code from the confirmation email. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordRegAccVerified({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'reg', name: 'acc_verified', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a reg_complete event: * Confirmation of Registration Successful (BE) Event that indicates a new account was successfully registered. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordRegComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'reg', name: 'complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a reg_email_sent event: * Registration Email Sent Event that indicates a registration email was sent in order to get email confirmation. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordRegEmailSent({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'reg', name: 'email_sent', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a reg_submit_error event: * Registration Submission Failure (Server) Event that indicates an attempt to submit a registration (clicking "Create account") was not successful. Ideally we would have additional data including reasons why the submission failed. We might expect most failed reasons to be "Incorrect password". * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} reason - additional context-dependent info, e.g. the cause of an error. */ recordRegSubmitError({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, reason, }) { const event = { category: 'reg', name: 'submit_error', extra: { reason: String(reason), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a relying_party_form_view event: * The Relying Party is using a button or a form with an input for an email address to take the user to FxA. The RP has displayed the form to the user. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} type - the type of form the RP showed the user. */ recordRelyingPartyFormView({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, type, }) { const event = { category: 'relying_party', name: 'form_view', extra: { type: String(type), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a third_party_auth_apple_login_complete event: * A user successfully logged in with Apple OAuth and a Mozilla account is also created if one was not already. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {boolean} linking - Indicates the initial linking of the Mozilla account and the third-party account.. */ recordThirdPartyAuthAppleLoginComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, linking, }) { const event = { category: 'third_party_auth', name: 'apple_login_complete', extra: { linking: String(linking), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a third_party_auth_apple_reg_complete event: * User completes registration with their Apple account. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordThirdPartyAuthAppleRegComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'third_party_auth', name: 'apple_reg_complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a third_party_auth_google_login_complete event: * A user successfully logged in with Google OAuth and a Mozilla is also created if one was not already. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {boolean} linking - Indicates the initial linking of the Mozilla account and the third-party account.. */ recordThirdPartyAuthGoogleLoginComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, linking, }) { const event = { category: 'third_party_auth', name: 'google_login_complete', extra: { linking: String(linking), }, }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a third_party_auth_google_reg_complete event: * User completes registration with their Google account. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordThirdPartyAuthGoogleRegComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'third_party_auth', name: 'google_reg_complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a third_party_auth_set_password_complete event: * Password for third party user was successfully created * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordThirdPartyAuthSetPasswordComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'third_party_auth', name: 'set_password_complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_factor_auth_code_complete event: * User successfully submitted a backup authentication code to complete two factor auth setup. * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoFactorAuthCodeComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_factor_auth', name: 'code_complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_factor_auth_replace_code_complete event: * Event that indicates the user successfully replaced their two-step authentication codes * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoFactorAuthReplaceCodeComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_factor_auth', name: 'replace_code_complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_step_auth_phone_code_complete event: * User successfully entered and submitted an authentication code * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoStepAuthPhoneCodeComplete({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_step_auth_phone_code', name: 'complete', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_step_auth_phone_code_send_error event: * Event that indicates that there was an error in sending the code to the phone * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoStepAuthPhoneCodeSendError({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_step_auth_phone_code', name: 'send_error', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_step_auth_phone_code_sent event: * 6 digit code is successfully sent to the phone number provided * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoStepAuthPhoneCodeSent({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_step_auth_phone_code', name: 'sent', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_step_auth_phone_remove_success event: * Event that indicates the user successfully remove their phone recovery option * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoStepAuthPhoneRemoveSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_step_auth_phone_remove', name: 'success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } /** * Record and submit a two_step_auth_remove_success event: * Event that indicates the user successfully remove two-step authentication * Event is logged using internal mozlog logger. * * @param {string} user_agent - The user agent. * @param {string} ip_address - The IP address. Will be used to decode Geo * information and scrubbed at ingestion. * @param {string} account_user_id - The firefox/mozilla account id. * @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid. * @param {string} relying_party_oauth_client_id - The client id of the relying party. * @param {string} relying_party_service - The service name of the relying party. * @param {string} session_device_type - one of 'mobile', 'tablet', or ''. * @param {string} session_entrypoint - Entrypoint to the service. * @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint. * @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint. * @param {string} session_flow_id - an ID generated by FxA for its flow metrics. * @param {string} utm_campaign - A marketing campaign. For example, if a user signs into FxA from selecting a Mozilla VPN plan on Mozilla VPN's product site, then the value of this metric could be 'vpn-product-page'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters. The special value of 'page+referral+-+not+part+of+a+campaign' is also allowed.. * @param {string} utm_content - The content on which the user acted. For example, if the user clicked on the (previously available) "Get started here" link in "Looking for Firefox Sync? Get started here", then the value for this metric would be 'fx-sync-get-started'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_medium - The "medium" on which the user acted. For example, if the user clicked on a link in an email, then the value of this metric would be 'email'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_source - The source from where the user started. For example, if the user clicked on a link on the Mozilla accounts web site, this value could be 'fx-website'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. * @param {string} utm_term - This metric is similar to the `utm.source`; it is used in the Firefox browser. For example, if the user started from about:welcome, then the value could be 'aboutwelcome-default-screen'. The value has a max length of 128 characters with the alphanumeric characters, _ (underscore), forward slash (/), . (period), % (percentage sign), and - (hyphen) in the allowed set of characters.. */ recordTwoStepAuthRemoveSuccess({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, }) { const event = { category: 'two_step_auth_remove', name: 'success', }; this.#record({ user_agent, ip_address, account_user_id, account_user_id_sha256, relying_party_oauth_client_id, relying_party_service, session_device_type, session_entrypoint, session_entrypoint_experiment, session_entrypoint_variation, session_flow_id, utm_campaign, utm_content, utm_medium, utm_source, utm_term, event, }); } } /** * Factory function that creates an instance of Glean Server Event Logger to * record `accounts-events` ping events. * @param {string} applicationId - The application ID. * @param {string} appDisplayVersion - The application display version. * @param {string} channel - The channel. * @param {Object} logger_options - The logger options. * @returns {EventsServerEventLogger} An instance of EventsServerEventLogger. */ module.exports.createAccountsEventsEvent = function ({ applicationId, appDisplayVersion, channel, logger_options, }) { return new AccountsEventsServerEvent( applicationId, appDisplayVersion, channel, logger_options ); }; /** * Factory function that creates an instance of Glean Server Event Logger to * record `events` ping events. * @param {string} applicationId - The application ID. * @param {string} appDisplayVersion - The application display version. * @param {string} channel - The channel. * @param {Object} logger_options - The logger options. * @returns {EventsServerEventLogger} An instance of EventsServerEventLogger. */ module.exports.createEventsServerEventLogger = function ({ applicationId, appDisplayVersion, channel, logger_options, }) { return new EventsServerEventLogger( applicationId, appDisplayVersion, channel, logger_options ); };