Bug 1465704 - Add follow_urlbar_link event telemetry for Savant Shield study; r=adw draft
authorBianca Danforth <bdanforth@mozilla.com>
Wed, 06 Jun 2018 03:51:01 -0700
changeset 805878 26a84bd3c58fe24c293448f2d60e413ec62c682d
parent 805863 19336dcf1332be537887760fff3e80d1de5a25c1
child 805938 83ee5cb70e11effed0ef3b8a66251dc712f55bad
push id112796
push userbdanforth@mozilla.com
push dateFri, 08 Jun 2018 17:09:04 +0000
reviewersadw
bugs1465704
milestone62.0a1
Bug 1465704 - Add follow_urlbar_link event telemetry for Savant Shield study; r=adw These probes will register and record (for the duration of the study only): * When the user clicks on a history link displayed by the urlbar * When the user clicks on a bookmark link displayed by the urlbar It should be noted that the same site can be multiple result types at the same time, so there will be times when a bookmark and/or history selection is captured as a result type other than bookmark or history (e.g. 'switchtab', 'autofill' or 'visiturl'). MozReview-Commit-ID: FEKVoaTIkiH
browser/modules/BrowserUsageTelemetry.jsm
toolkit/components/telemetry/Events.yaml
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -301,16 +301,20 @@ let urlbarListener = {
     // Otherwise you'll break our data.
     if (actionType in URLBAR_SELECTED_RESULT_TYPES) {
       Services.telemetry
               .getHistogramById("FX_URLBAR_SELECTED_RESULT_TYPE")
               .add(URLBAR_SELECTED_RESULT_TYPES[actionType]);
       Services.telemetry
               .getKeyedHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX_BY_TYPE")
               .add(actionType, idx);
+      if (actionType === "bookmark" || actionType === "history") {
+        Services.telemetry.recordEvent("savant", "follow_urlbar_link", actionType, null,
+                                      { subcategory: "navigation" });
+      }
     } else {
       Cu.reportError("Unknown FX_URLBAR_SELECTED_RESULT_TYPE type: " +
                      actionType);
     }
   },
 
   QueryInterface: ChromeUtils.generateQI([Ci.nsIObserver,
                                           Ci.nsISupportsWeakReference]),
--- a/toolkit/components/telemetry/Events.yaml
+++ b/toolkit/components/telemetry/Events.yaml
@@ -169,16 +169,29 @@ savant:
       This is recorded any time a bookmark is visited.
     bug_numbers: [1457226, 1465703]
     notification_emails:
       - "bdanforth@mozilla.com"
       - "shong@mozilla.com"
     expiry_version: "65"
     extra_keys:
       subcategory: The broad event category for this probe. E.g. navigation
+  follow_urlbar_link:
+    objects: ["bookmark", "history"]
+    release_channel_collection: opt-out
+    record_in_processes: ["main"]
+    description: >
+      This is recorded when the user selects a urlbar bookmark or history result.
+    bug_numbers: [1457226, 1465704]
+    notification_emails:
+      - "bdanforth@mozilla.com"
+      - "shong@mozilla.com"
+    expiry_version: "65"
+    extra_keys:
+      subcategory: The broad event category for this probe. E.g. navigation
 
 # This category contains event entries used for Telemetry tests.
 # They will not be sent out with any pings.
 telemetry.test:
   test:
     methods: ["test1", "test2"]
     objects: ["object1", "object2"]
     bug_numbers: [1286606]