This commit is contained in:
Wil Clouser 2022-03-21 17:56:34 -07:00 коммит произвёл GitHub
Родитель e3aca31531
Коммит 41e90b5086
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 10 добавлений и 28 удалений

Просмотреть файл

@ -6,24 +6,24 @@
## Introduction
This article provides an overview of Firefox Accounts metrics: what is measured and how. See the other articles in this chapter for more details about the specific measurements that are available for analysis.
This article provides an overview of Firefox accounts metrics: what is measured and how. See the other articles in this chapter for more details about the specific measurements that are available for analysis.
The [Firefox accounts documentation](https://mozilla.github.io/ecosystem-platform/reference/metrics) maintains additional detail, as well as the source code, for the metrics described here.
## What is Firefox Accounts?
[Firefox Accounts](https://www.mozilla.org/en-US/firefox/accounts/) is Mozilla's authentication solution for account-based end-user services and features. At the time of writing, sync is by far the most popular account-relying service. Below is a partial list of current FxA-relying services (by the time you are reading this others will likely have been added; we will endeavor to update the list periodically):
[Firefox accounts](https://www.mozilla.org/en-US/firefox/accounts/) is Mozilla's authentication solution for account-based end-user services and features. At the time of writing, sync is by far the most popular account-relying service. Below is a partial list of current FxA-relying services:
- [Sync](https://support.mozilla.org/en-US/kb/how-do-i-set-sync-my-computer)
- Requires FxA.
- [Firefox Send](https://send.firefox.com/)
- FxA Optional; Required to send large files.
- [Lockwise](https://lockwise.firefox.com/)
- Requires FxA and sync.
- [AMO](https://addons.mozilla.org/en-US/firefox/)
- For developer accounts; not required by end-users to use or download addons.
- [Pocket](https://getpocket.com/login/?ep=1)
- FxA is an optional authentication method among others.
- [Monitor](https://monitor.firefox.com)
- Required to receive email alerts. Not required for email scans.
- [Relay](https://relay.firefox.com/)
- Required to use the service
- [Mozilla IAM](https://wiki.mozilla.org/IAM/Frequently_asked_questions)
- Optional authentication method among others.
@ -35,7 +35,7 @@ One more thing: China runs its own stack for sync, but Chinese sign-ups for oaut
## Metrics Background
Unlike most telemetry described in these docs, FxA metrics are logged server-side. There are many [FxA "servers"](https://github.com/mozilla/fxa/tree/main/packages) that handle different aspects of account authentication and management. The metrics of most interest to data analysts are logged by the FxA auth server, content server and oauth server. Each server writes their metrics into their log stream, and some post-processing scripts combine the metrics events from all three servers into datasets that are available in Databricks, BigQuery, STMO and Amplitude.
Unlike most telemetry described in these docs, FxA metrics are logged server-side. There are many [FxA "servers"](https://github.com/mozilla/fxa/tree/main/packages) that handle different aspects of account authentication and management. The metrics of most interest to data analysts are logged by the FxA auth server, content server and oauth server. Each server writes their metrics into their log stream, and some post-processing scripts combine the metrics events from all three servers into datasets that are available in BigQuery.
In general, metrics logged by the [FxA auth server](https://github.com/mozilla/fxa/tree/main/packages/fxa-auth-server) reflect authentication events such as account creation, logins to existing accounts, etc.
Metrics logged by the [FxA content server](https://github.com/mozilla/fxa/tree/main/packages/fxa-content-server) reflect user interaction and progression through the FxA web UI - form views, form engagement, form submission, etc.
@ -45,20 +45,12 @@ The [FxA oauth server](https://github.com/mozilla/fxa/pull/3176) logs metrics ev
There are two overlapping taxonomies or sets of FxA event metrics.
[**Flow Metrics**](https://github.com/mozilla/fxa-auth-server/blob/master/docs/metrics-events.md): these are an older set of metrics events that can be queried through redshift and via the `FxA Activity Metrics` data source in STMO. The [STMO import jobs](https://github.com/mozilla/fxa-activity-metrics/) are run once a day. See [this documentation](https://github.com/mozilla/fxa-auth-server/blob/master/docs/metrics-events.md) for detailed description of the types of flow events that are logged and the tables that contain them (note this documentation does not contain an exhaustive list of all flow metrics but is generally still accurate about the ones that are described). Note there are 50% and 10% sampled versions of the major tables, which contain more historical data than their complete counterparts. Complete tables go back 3 months, 50% tables go back 6 months, and 10% tables go back 24 months. Sampling is done at the level of the FxA user id `uid` (i.e. integer(`uid`) % 100).
[**Flow Metrics**](https://github.com/mozilla/fxa-auth-server/blob/master/docs/metrics-events.md): these are an older set of metrics events that can be queried through the `firefox_accounts` dataset in the `mozdata` project in BigQuery. See [this documentation](https://github.com/mozilla/fxa-auth-server/blob/master/docs/metrics-events.md) for detailed description of the types of flow events that are logged and the tables that contain them (note this documentation does not contain an exhaustive list of all flow metrics but is generally still accurate about the ones that are described).
[**Amplitude Events**](https://analytics.amplitude.com/mozilla-corp/manage/project/178231/advanced/events): FxA started to send metrics events to amplitude circa October 2017. The [code responsible for batching events to amplitude](https://github.com/mozilla/fxa-amplitude-send) over HTTP is run in more-or-less real-time. Amplitude events can be queried through the [amplitude UI](https://analytics.amplitude.com/mozilla-corp/space/vj9qof9) as well as various views in `moz-fx-data-shared-prod.firefox_accounts` dataset in BigQuery that maintain copies of the events that are sent to Amplitude. [`moz-fx-data-shared-prod.firefox_accounts.fxa_content_auth_events`](https://github.com/mozilla/bigquery-etl/blob/master/sql/moz-fx-data-shared-prod/firefox_accounts/fxa_content_auth_events/view.sql) is probably the easiest BigQuery view to use, though it does not contain email bounce events and (at the time of writing) only contains data starting at 2019-03-01.
**Amplitude Events**: FxA started to send metrics events to amplitude circa October 2017 and ended around June 2020. While we stopped using Amplitude, the term Amplitude Events lives on to reference this set of events. Amplitude events can be queried through the `moz-fx-data-shared-prod.firefox_accounts` dataset in BigQuery. [`moz-fx-data-shared-prod.firefox_accounts.fxa_content_auth_events`](https://github.com/mozilla/bigquery-etl/blob/master/sql/moz-fx-data-shared-prod/firefox_accounts/fxa_content_auth_events/view.sql) is probably the easiest BigQuery view to use, though it does not contain email bounce events.
Note that the BigQuery [ETL jobs](https://github.com/mozilla/bigquery-etl/tree/master/sql) run daily while real-time data is accessible through the amplitude UI.
Note that the BigQuery [ETL jobs](https://github.com/mozilla/bigquery-etl/tree/master/sql) run daily.
FxA's amplitude metrics were originally just re-configured and re-named versions of the flow metrics. However things have since diverged a bit and there are now metrics events that only have an amplitude version but no corresponding flow event, and vice-versa. If you are wondering whether a certain event is logged its likely you will have to check both data sources.
**Generally speaking, one should first try to use the amplitude metrics rather than the flow events** for these reasons:
1. For quick answers to simple questions the amplitude UI is often more efficient than writing SQL.
- The caveat here is that is can sometimes be _too_ easy to build a chart in amplitude - it doesn't exactly encourage the careful consideration that having to write a query out by hand implicitly encourages.
2. By-country data is currently not available in redshift.
3. There have been outages in the redshift data that have not affected the amplitude data.
4. Querying redshift is (generally) slower.
It is also possible to query the FxA server logs directly through BigQuery (ask an FxA team member for access), though virtually all analytics-related questions are more easily answered using the data sources described above.

Просмотреть файл

@ -18,12 +18,8 @@ There is a variable called `service` that we use to (1) attribute users to the r
| `service` | oauth `client_id` | Description |
| --------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lockbox` | `e7ce535d93522896` | Lockwise App for Android |
| `lockbox` | `98adfa37698f255b` | Lockwise App for iOS |
| `fenix` | `a2270f727f45f648` | Sync implementation for Fenix |
| `fx-monitor` | `802d56ef2a9af9fa` | Firefox Monitor ([website](https://monitor.firefox.com)) |
| `send` | `1f30e32975ae5112` | Firefox Send ([website](https://send.firefox.com/)) |
| `send` | `20f7931c9054d833` | Firefox Send (android app) |
| `pocket-mobile` | `7377719276ad44ee` | Pocket Mobile App |
| `pocket-web` | `749818d3f2e7857f` | Pocket Website |
| `firefox-addons` | `3a1f53aabe17ba32` | `addons.mozilla.org` |
@ -34,9 +30,6 @@ There is a variable called `service` that we use to (1) attribute users to the r
| `fxa-content` | `ea3ca969f8c6bb0d` | Oauth ID used when a user is signing in with cached credentials (i.e. does not have to re-enter username/password) and when the user is logging into the FxA settings page. |
| `mozilla-email-preferences` | `c40f32fd2938f0b6` | Oauth ID used when a user is signing in to modify their marketing email preferences (e.g., to opt-out.) |
In amplitude, there is also a `fxa_services_used` user property which maintains an array of all the services a user has authenticated with.
Some amplitude charts segmenting by service can be found [here](https://analytics.amplitude.com/mozilla-corp/notebook/detelo9).
### Funnel Attribution (entrypoint and utm parameters)
@ -55,6 +48,3 @@ See the [Metrics for Relying Parties](https://mozilla.github.io/ecosystem-platfo
| `preferences` | NA | The "sign into sync" button found in the sync section in desktop preferences. |
| `synced-tabs` | NA | The "sign into sync" button found in synced-tabs section under the library menu. |
| `sendtab` | NA | The "sign into sync" button found in the "send tab to device" menu accessible by right-clicking on a tab. |
| `lockbox-addon` | NA | The "sign into sync" button found within the the Lockwise desktop extension. This is likely to change once Lockwise becomes fully integrated into the browser. |
Example amplitude charts: [registrations by `entrypoint`](https://analytics.amplitude.com/mozilla-corp/chart/1ush8xd), [logins by `entrypoint`](https://analytics.amplitude.com/mozilla-corp/chart/y8t2k1z), [registrations by `utm_source`](https://analytics.amplitude.com/mozilla-corp/chart/jjbkusl).