Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Telemetry

Michael Comella edited this page Feb 9, 2018 · 33 revisions

For clients that have "send anonymous usage data" enabled Firefox for Fire TV sends a "core" ping and an "event" ping to Mozilla's telemetry service. Sending telemetry can be disabled in the app's settings. Builds of "Firefox for Fire TV" have telemetry enabled by default ("opt-out").

Core ping

Firefox for Fire TV creates and tries to send a "core" ping whenever the app goes to the background. This core ping uses the same format as Firefox for Android and is documented on firefox-source-docs.mozilla.org.

Event ping

In addition to the core ping an event ping for UI telemetry is generated and sent as soon as the app is sent to the background.

Settings

As part of the event ping the most recent state of the user's setting is sent (default values in bold):

Setting Key Value
Default search engine pref_search_engine bundled engine name/custom(*)
Block ad trackers pref_privacy_block_ads true/false
Block analytics trackers pref_privacy_block_analytics true/false
Block social trackers pref_privacy_block_social true/false
Block content trackers pref_privacy_block_other true/false
Block web fonts pref_performance_block_webfonts true/false
Block images pref_performance_block_images true/false
Locale override pref_locale empty string/locale-code(*)
Default browser pref_default_browser true/false
Stealth mode pref_secure true/false
Autocomplete (Default) pref_autocomplete_preinstalled true/false
Autocomplete (Custom) pref_autocomplete_custom true/false

(*) If the default is one of the bundled engines, the name of the engine. Otherwise, just custom.

(*) An empty string value indicates "System Default" locale is selected.

Events

The event ping contains a list of events (see event format on readthedocs.io) for the following actions:

Sessions

Event category method object value
Start session (App is in the foreground) action foreground app
Stop session (App is in the background) action background app

Browsing

Event category method object value extras.
URL entered action type_url search_bar options*
Search entered action type_query search_bar
Search hint clicked ("Search for ..") action select_query search_bar
Link from third-party app action intent_url app
Text selection action from app action text_selection_intent app
Long press on image / link action long_press browser
"Pull to refresh" action swipe browser reload
Autofill popup is shown action show autofill
Autofill performed action click autofill

(*) options is a JSON map containing:

{
  "autocomplete": true,  // Was the URL autocompleted?
  "source":  "default",  // Which autocomplete list was used ("default" or "custom")?  (Only present if autocomplete is true)
  "total": 25            // Total number of items in the used autocomplete list (Only present if autocomplete is true)
}

SSL Errors

Event category method object extras
SSL Error From Page error page browser error*
SSL Error From Resource error resource browser error*

(*)error is a JSON map containing the primary SSL Error

{
  "error_code": "SSL_DATE_INVALID"  // Primary SSL Error
}
Possible Error Codes
SSL_DATE_INVALID
SSL_EXPIRED
SSL_IDMISMATCH
SSL_NOTYETVALID
SSL_UNTRUSTED
SSL_INVALID
Undefined SSL Error

Limits

  • An event ping will contain up to but no more than 500 events
  • No more than 40 pings per type (core/event) are stored on disk for upload at a later time
  • No more than 100 pings are sent per day

Implementation notes

  • Event pings are generated (and stored on disk) whenever the onStop() callback of the main activity is triggered. This happens whenever the main screen of the app is no longer visible (The app is in the background or another screen is displayed on top of the app).

  • Whenever we are storing pings we are also scheduling an upload. We are using Android’s JobScheduler API for that. This allows the system to run the background task whenever it is convenient and certain criterias are met. The only criteria we are specifying is that we require an active network connection. In most cases this job is executed immediately after the app is in the background.

  • Whenever an upload fails we are scheduling a retry. The first retry will happen after 30 seconds (or later if there’s no active network connection at this time). For further retries a exponential backoff policy is used: [30 seconds] * 2 ^ (num_failures - 1)

  • An earlier retry of the upload can happen whenever the app is coming to the foreground and sent to the background again (the previous scheduled job is reset and we are starting all over again).

Clone this wiki locally