Skip to content

Commit 9474117

Browse files
author
Micah Tigley
committed
Bug 1947634 - Add a Glean event for CPM tile interactions. r=rsafaeian,credential-management-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D237950
1 parent 7dca976 commit 9474117

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

toolkit/components/satchel/megalist/content/components/password-card/password-card.mjs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,14 @@ export class PasswordCard extends MozLitElement {
127127
this.messageToViewModel("Command", { commandId, snapshotId: lineIndex });
128128
}
129129

130+
#recordInteractionType(type) {
131+
Glean.contextualManager.interactionType.record({
132+
interaction_type: type,
133+
});
134+
}
135+
130136
async onEditButtonClick() {
137+
this.#recordInteractionType("edit");
131138
const isAuthenticated = await this.reauthCommandHandler(() =>
132139
this.messageToViewModel("Command", {
133140
commandId: "Edit",
@@ -144,10 +151,12 @@ export class PasswordCard extends MozLitElement {
144151

145152
onViewAlertClick() {
146153
this.handleViewAlertClick();
154+
this.#recordInteractionType("view_alert");
147155
}
148156

149157
#onOriginLineClick(lineIndex) {
150158
this.handleCommand("OpenLink", lineIndex);
159+
this.#recordInteractionType("url_navigate");
151160
}
152161

153162
#onCopyButtonClick(lineIndex) {
@@ -197,6 +206,7 @@ export class PasswordCard extends MozLitElement {
197206
.value=${this.username.value}
198207
.onLineClick=${() => {
199208
this.#onCopyButtonClick(this.username.lineIndex);
209+
this.#recordInteractionType("copy_username");
200210
return true;
201211
}}
202212
?alert=${!this.username.value.length}
@@ -213,17 +223,24 @@ export class PasswordCard extends MozLitElement {
213223
.value=${this.password.value}
214224
.visible=${!this.password.concealed}
215225
?alert=${this.password.vulnerable}
216-
.onLineClick=${() =>
217-
this.reauthCommandHandler(() =>
218-
this.#onCopyButtonClick(this.password.lineIndex)
219-
)}
220-
.onButtonClick=${() =>
226+
.onLineClick=${() => {
227+
this.reauthCommandHandler(() => {
228+
this.#onCopyButtonClick(this.password.lineIndex);
229+
});
230+
this.#recordInteractionType("copy_password");
231+
}}
232+
.onButtonClick=${() => {
233+
const interactionType = this.password.concealed
234+
? "view_password"
235+
: "hide_password";
236+
this.#recordInteractionType(interactionType);
221237
this.reauthCommandHandler(() =>
222238
this.onPasswordRevealClick(
223239
this.password.concealed,
224240
this.password.lineIndex
225241
)
226-
)}
242+
);
243+
}}
227244
>
228245
</concealed-login-line>
229246
`;

toolkit/components/satchel/megalist/metrics.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,30 @@ contextual_manager:
4848
description: >
4949
The action selected from the toolbar
5050
type: string
51+
52+
records_interaction:
53+
type: event
54+
description: >
55+
Client interacts with existing CM tile
56+
Possible interaction types include:
57+
"url_navigate": When the origin field is clicked
58+
"copy_username": When the username field is clicked
59+
"copy_password": When the password field is clicked
60+
"view_password": When the reveal password button is clicked
61+
"hide_password": When the hide password button is clicked
62+
"edit": When the edit button is clicked
63+
"view_alert": When the "View alert" button is clicked
64+
bugs:
65+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1947634
66+
data_reviews:
67+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1947634
68+
notification_emails:
69+
- passwords-dev@mozilla.org
70+
- issozi@mozilla.com
71+
- tthorne@mozilla.com
72+
expires: never
73+
extra_keys:
74+
interaction_type:
75+
description: >
76+
The type of user interaction with the CM record tile
77+
type: string

0 commit comments

Comments
 (0)