You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because:
* We want full metrics coverage for the 2FA flows before rolling out recovery phone
This commit:
* Add missing 2FA setup custom events, automated click events, and reason codes (ensure events have reason codes for setup from settings, inline or to replace codes)
Closes #FXA-11087
Copy file name to clipboardExpand all lines: packages/fxa-auth-server/lib/metrics/glean/server_events.ts
+82Lines changed: 82 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4066,6 +4066,88 @@ class EventsServerEventLogger {
4066
4066
event,
4067
4067
});
4068
4068
}
4069
+
/**
4070
+
* Record and submit a two_factor_auth_replace_code_complete event:
4071
+
* Event that indicates the user successfully replaced their two-step authentication codes
4072
+
* Event is logged using internal mozlog logger.
4073
+
*
4074
+
* @param {string} user_agent - The user agent.
4075
+
* @param {string} ip_address - The IP address. Will be used to decode Geo
4076
+
* information and scrubbed at ingestion.
4077
+
* @param {string} account_user_id - The firefox/mozilla account id.
4078
+
* @param {string} account_user_id_sha256 - A hex string of a sha256 hash of the account's uid.
4079
+
* @param {string} relying_party_oauth_client_id - The client id of the relying party.
4080
+
* @param {string} relying_party_service - The service name of the relying party.
4081
+
* @param {string} session_device_type - one of 'mobile', 'tablet', or ''.
4082
+
* @param {string} session_entrypoint - Entrypoint to the service.
4083
+
* @param {string} session_entrypoint_experiment - Identifier for the experiment the user is part of at the entrypoint.
4084
+
* @param {string} session_entrypoint_variation - Identifier for the experiment variation the user is part of at the entrypoint.
4085
+
* @param {string} session_flow_id - an ID generated by FxA for its flow metrics.
4086
+
* @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..
4087
+
* @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..
4088
+
* @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..
4089
+
* @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..
4090
+
* @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..
4091
+
*/
4092
+
recordTwoFactorAuthReplaceCodeComplete({
4093
+
user_agent,
4094
+
ip_address,
4095
+
account_user_id,
4096
+
account_user_id_sha256,
4097
+
relying_party_oauth_client_id,
4098
+
relying_party_service,
4099
+
session_device_type,
4100
+
session_entrypoint,
4101
+
session_entrypoint_experiment,
4102
+
session_entrypoint_variation,
4103
+
session_flow_id,
4104
+
utm_campaign,
4105
+
utm_content,
4106
+
utm_medium,
4107
+
utm_source,
4108
+
utm_term,
4109
+
}: {
4110
+
user_agent: string;
4111
+
ip_address: string;
4112
+
account_user_id: string;
4113
+
account_user_id_sha256: string;
4114
+
relying_party_oauth_client_id: string;
4115
+
relying_party_service: string;
4116
+
session_device_type: string;
4117
+
session_entrypoint: string;
4118
+
session_entrypoint_experiment: string;
4119
+
session_entrypoint_variation: string;
4120
+
session_flow_id: string;
4121
+
utm_campaign: string;
4122
+
utm_content: string;
4123
+
utm_medium: string;
4124
+
utm_source: string;
4125
+
utm_term: string;
4126
+
}){
4127
+
constevent={
4128
+
category: 'two_factor_auth',
4129
+
name: 'replace_code_complete',
4130
+
};
4131
+
this.#record({
4132
+
user_agent,
4133
+
ip_address,
4134
+
account_user_id,
4135
+
account_user_id_sha256,
4136
+
relying_party_oauth_client_id,
4137
+
relying_party_service,
4138
+
session_device_type,
4139
+
session_entrypoint,
4140
+
session_entrypoint_experiment,
4141
+
session_entrypoint_variation,
4142
+
session_flow_id,
4143
+
utm_campaign,
4144
+
utm_content,
4145
+
utm_medium,
4146
+
utm_source,
4147
+
utm_term,
4148
+
event,
4149
+
});
4150
+
}
4069
4151
/**
4070
4152
* Record and submit a two_step_auth_phone_code_complete event:
4071
4153
* User successfully entered and submitted an authentication code
0 commit comments