From a356b4b2c4feb052ed9ffae4fbb5d7917c882159 Mon Sep 17 00:00:00 2001 From: Sawyer Blatz Date: Fri, 20 Mar 2020 10:06:55 -0700 Subject: [PATCH] For #9136: Send all adjust properties to glean (#9253) --- app/metrics.yaml | 50 +++++++++++++++++++ app/pings.yaml | 2 +- .../components/metrics/GleanMetricsService.kt | 5 ++ docs/metrics.md | 3 ++ 4 files changed, 59 insertions(+), 1 deletion(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index 4e18979af..75f13acc4 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -360,11 +360,61 @@ metrics: - metrics bugs: - https://github.com/mozilla-mobile/fenix/issues/1298 + - https://github.com/mozilla-mobile/fenix/issues/9136 data_reviews: - https://github.com/mozilla-mobile/fenix/pull/5579 notification_emails: - fenix-core@mozilla.com expires: "2020-09-01" + adjust_ad_group: + type: string + lifetime: application + description: > + A string containing the Adjust ad group ID from which the user installed Fenix. This will not + send on the first session the user runs. If the install is organic, this will be empty. + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/1298 + - https://github.com/mozilla-mobile/fenix/issues/9136 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/9253 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + adjust_creative: + type: string + lifetime: application + description: > + A string containing the Adjust creative ID from which the user installed Fenix. This will not + send on the first session the user runs. If the install is organic, this will be empty. + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/1298 + - https://github.com/mozilla-mobile/fenix/issues/9136 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/9253 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + adjust_network: + type: string + lifetime: application + description: > + A string containing the Adjust network ID from which the user installed Fenix. This will not + send on the first session the user runs. If the install is organic, this will be empty. + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/1298 + - https://github.com/mozilla-mobile/fenix/issues/9136 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/9253 + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + toolbar_position: type: string lifetime: application diff --git a/app/pings.yaml b/app/pings.yaml index 5aa95833e..3083e9ab0 100644 --- a/app/pings.yaml +++ b/app/pings.yaml @@ -22,7 +22,7 @@ activation: installation: description: > This ping is intended to capture the source of the installation - include_client_id: false + include_client_id: true bugs: - https://github.com/mozilla-mobile/fenix/issues/7295 data_reviews: diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index e085490e7..acdad31c9 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -545,7 +545,12 @@ class GleanMetricsService(private val context: Context) : MetricsService { defaultMozBrowser.set(it) } mozillaProducts.set(MozillaProductDetector.getInstalledMozillaProducts(context)) + adjustCampaign.set(context.settings().adjustCampaignId) + adjustAdGroup.set(context.settings().adjustAdGroup) + adjustCreative.set(context.settings().adjustCreative) + adjustNetwork.set(context.settings().adjustNetwork) + toolbarPosition.set( if (context.settings().shouldUseBottomToolbar) { Event.ToolbarPositionChanged.Position.BOTTOM.name diff --git a/docs/metrics.md b/docs/metrics.md index e3a45f1ce..e1af917f0 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -204,7 +204,10 @@ The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | | events.total_uri_count |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |A counter of URIs visited by the user in the current session, including page reloads. This does not include background page requests and URIs from embedded pages or private browsing. |[1](https://github.com/mozilla-mobile/fenix/pull/1785), [2](https://github.com/mozilla-mobile/fenix/pull/8314)||2020-09-01 | +| metrics.adjust_ad_group |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string containing the Adjust ad group ID from which the user installed Fenix. This will not send on the first session the user runs. If the install is organic, this will be empty. |[1](https://github.com/mozilla-mobile/fenix/pull/9253)||2020-09-01 | | metrics.adjust_campaign |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string containing the Adjust campaign ID from which the user installed Fenix. This will not send on the first session the user runs. If the install is organic, this will be empty. |[1](https://github.com/mozilla-mobile/fenix/pull/5579)||2020-09-01 | +| metrics.adjust_creative |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string containing the Adjust creative ID from which the user installed Fenix. This will not send on the first session the user runs. If the install is organic, this will be empty. |[1](https://github.com/mozilla-mobile/fenix/pull/9253)||2020-09-01 | +| metrics.adjust_network |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |A string containing the Adjust network ID from which the user installed Fenix. This will not send on the first session the user runs. If the install is organic, this will be empty. |[1](https://github.com/mozilla-mobile/fenix/pull/9253)||2020-09-01 | | metrics.default_browser |[boolean](https://mozilla.github.io/glean/book/user/metrics/boolean.html) |Is Fenix the default browser? |[1](https://github.com/mozilla-mobile/fenix/pull/1067#issuecomment-474598673)||2020-09-01 | | metrics.default_moz_browser |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The name of the default browser on device if and only if it's a Mozilla owned product |[1](https://github.com/mozilla-mobile/fenix/pull/1953/), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-09-01 | | metrics.mozilla_products |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |A list of all the Mozilla products installed on device. We currently scan for: Firefox, Firefox Beta, Firefox Aurora, Firefox Nightly, Firefox Fdroid, Firefox Lite, Reference Browser, Reference Browser Debug, Fenix, Focus, and Lockwise. |[1](https://github.com/mozilla-mobile/fenix/pull/1953/), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-09-01 |