Bug 1371232 - Add scalars to record the times of credit card filling type. r=lchang draft
authorsteveck-chung <schung@mozilla.com>
Thu, 31 Aug 2017 18:28:39 +0800
changeset 656528 11251811dce4b2a3f96dc7fe5bb9246858d65588
parent 656346 04b6be50a2526c7a26a63715f441c47e1aa1f9be
child 729186 4b15c36b66c54d6ebd383928746e5fce51e125c3
push id77263
push userbmo:schung@mozilla.com
push dateThu, 31 Aug 2017 10:51:58 +0000
reviewerslchang
bugs1371232
milestone57.0a1
Bug 1371232 - Add scalars to record the times of credit card filling type. r=lchang MozReview-Commit-ID: IyUKrjF99oK
browser/extensions/formautofill/FormAutofillParent.jsm
toolkit/components/telemetry/Scalars.yaml
--- a/browser/extensions/formautofill/FormAutofillParent.jsm
+++ b/browser/extensions/formautofill/FormAutofillParent.jsm
@@ -418,19 +418,26 @@ FormAutofillParent.prototype = {
   },
 
   async _onCreditCardSubmit(creditCard, target) {
     // We'll show the credit card doorhanger if:
     //   - User applys autofill and changed
     //   - User fills form manually
     if (creditCard.guid &&
         Object.keys(creditCard.record).every(key => creditCard.untouchedFields.includes(key))) {
+      // Add probe to record credit card autofill(without modification).
+      Services.telemetry.scalarAdd("formautofill.creditCards.fill_type_autofill", 1);
       return;
     }
 
+    // Add the probe to record credit card manual filling or autofill but modified case.
+    let ccScalar = creditCard.guid ? "formautofill.creditCards.fill_type_autofill_modified" :
+                                     "formautofill.creditCards.fill_type_manual";
+    Services.telemetry.scalarAdd(ccScalar, 1);
+
     let state = await FormAutofillDoorhanger.show(target, "creditCard");
     if (state == "cancel") {
       return;
     }
 
     if (state == "disable") {
       Services.prefs.setBoolPref("extensions.formautofill.creditCards.enabled", false);
       return;
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -925,16 +925,59 @@ formautofill.addresses:
     notification_emails:
       - autofill@lists.mozilla.org
       - jcheng@mozilla.com
       - chsiang@mozilla.com
     release_channel_collection: opt-out
     record_in_processes:
       - 'main'
 
+formautofill.creditCards:
+  fill_type_manual:
+    bug_numbers:
+      - 1371232
+    description: Count at submission time whether the submitted credit card form was filled manually.
+    expires: never
+    kind: uint
+    notification_emails:
+      - autofill@lists.mozilla.org
+      - jcheng@mozilla.com
+      - chsiang@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
+  fill_type_autofill:
+    bug_numbers:
+      - 1371232
+    description: Count at submission time whether the submitted credit card form was autofilled.
+    expires: never
+    kind: uint
+    notification_emails:
+      - autofill@lists.mozilla.org
+      - jcheng@mozilla.com
+      - chsiang@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
+  fill_type_autofill_modified:
+    bug_numbers:
+      - 1371232
+    description: >
+      Count at submission time whether the submitted credit card form was autofilled but
+      the data in form is changed.
+    expires: never
+    kind: uint
+    notification_emails:
+      - autofill@lists.mozilla.org
+      - jcheng@mozilla.com
+      - chsiang@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
+
 # The following section is for probes for tcp protocol.
 network.tcp:
   overlapped_io_canceled_before_finished:
     bug_numbers:
       - 1363372
     description: >
       Count the number of sockets that use overlapped io and are canceled before
       the overlapped io finishes. (We only use overlapped io for connectEx when