Bug 1534207 Search Widget missing TELEMETRY probe for searches initiated r=petru
authorAndrei Lazar <andrei.a.lazar@softvision.ro>
Wed, 13 Mar 2019 16:10:41 +0000
changeset 521867 2c24099776a7c46fa4e764984901e386f5d83fd5
parent 521866 30b70cd830631e09d18fafe5937fdbc4ed4b1134
child 521868 e9e31edcc25a93b88e667ffa8d182d8c44a00310
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspetru
bugs1534207
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534207 Search Widget missing TELEMETRY probe for searches initiated r=petru Added a telemetry probe (unique source value) to allow data science to measure percentage of searches initiated from the widget. Differential Revision: https://phabricator.services.mozilla.com/D22956
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/docs/uitelemetry.rst
mobile/android/geckoview/src/main/java/org/mozilla/gecko/TelemetryContract.java
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -888,16 +888,17 @@ public class BrowserApp extends GeckoApp
     private boolean handleSearchWidgetIntent(Intent intent) {
         SearchWidgetProvider.InputType input = getWidgetInputType(intent);
 
         if (input == null) {
             return false;
         }
 
         MmaDelegate.track(INTERACT_WITH_SEARCH_WIDGET_URL_AREA);
+        Telemetry.sendUIEvent(TelemetryContract.Event.SEARCH, TelemetryContract.Method.WIDGET);
 
         switch (input) {
             case TEXT:
                 handleTabEditingMode(false);
                 return true;
             case VOICE:
                 handleTabEditingMode(true);
                 return true;
--- a/mobile/android/docs/uitelemetry.rst
+++ b/mobile/android/docs/uitelemetry.rst
@@ -193,16 +193,19 @@ Events
   Sent when the user removes a search engine.
 
 ``search.restore.1``
   Sent when the user restores the search engine configuration back to the built-in configuration.
 
 ``search.setdefault.1``
   Sent when the user sets a search engine to be the default.
 
+``search.widget.1``
+  Sent when the user initiates a search through the widget.
+
 ``share.1``
   Sharing content.
 
 ``show.1``
   Sent when a contextual UI element is shown to the user.
 
 ``undo.1``
   Sent when performing an undo-style action, like undoing a closed tab.
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/TelemetryContract.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/TelemetryContract.java
@@ -83,16 +83,19 @@ public interface TelemetryContract {
         SEARCH_REMOVE("search.remove.1"),
 
         // Restore default search engines.
         SEARCH_RESTORE_DEFAULTS("search.restoredefaults.1"),
 
         // Set default search engine.
         SEARCH_SET_DEFAULT("search.setdefault.1"),
 
+        // Searches initiated from the widget.
+        SEARCH_WIDGET("search.widget.1"),
+
         // Sharing content.
         SHARE("share.1"),
 
         // Show a UI element.
         SHOW("show.1"),
 
         // Undoing a user action.
         // Note: Only used in JavaScript for now, but here for completeness.