diff --git a/app/metrics.yaml b/app/metrics.yaml index 6cf6558a0..31f524f7d 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -415,7 +415,8 @@ metrics: type: string lifetime: application description: > - A string containing the Adjust campaign ID from which the user installed Fenix + 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. send_in_pings: - metrics bugs: diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index db7b09edf..8c3615be9 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -94,3 +94,17 @@ # Keep motionlayout internal methods # https://github.com/mozilla-mobile/fenix/issues/2094 -keep class androidx.constraintlayout.** { *; } + +# Keep adjust relevant classes +-keep class com.adjust.sdk.** { *; } +-keep class com.google.android.gms.common.ConnectionResult { + int SUCCESS; +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient { + com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context); +} +-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info { + java.lang.String getId(); + boolean isLimitAdTrackingEnabled(); +} +-keep public class com.android.installreferrer.** { *; } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cf433599c..3850931ee 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ package="org.mozilla.fenix"> + diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt index 4e1946493..f2868a28c 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/AdjustMetricsService.kt @@ -35,13 +35,10 @@ class AdjustMetricsService(private val application: Application) : MetricsServic ) config.setOnAttributionChangedListener { - it.campaign?.let { campaign -> - application.settings().adjustCampaignId = campaign - } + application.applicationContext.settings().adjustCampaignId = it.campaign } config.setLogLevel(LogLevel.SUPRESS) - Adjust.onCreate(config) Adjust.setEnabled(true) application.registerActivityLifecycleCallbacks(AdjustLifecycleCallbacks()) diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 984673d58..a72b9b272 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -47,7 +47,7 @@ object Versions { const val mozilla_glean = "19.0.0" const val autodispose = "1.1.0" - const val adjust = "4.11.4" + const val adjust = "4.18.3" const val installreferrer = "1.0" const val junit = "4.12" diff --git a/docs/metrics.md b/docs/metrics.md index 2ab0c7692..c8697b49f 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -156,7 +156,7 @@ The following metrics are added to the ping: | Name | Type | Description | Data reviews | Extras | Expiration | | --- | --- | --- | --- | --- | --- | | experiments.metrics.active_experiment |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |Records the branch name of the active experiment, if the client is enrolled in the `fenix-test-2019-08-05` experiment. This is intended to validate that the service-experiments library properly matches clients to experiments and can take action based on a multi-branched experiment. This is done by recording the experiment branch name in this string metric which allows the experiment to be transparent and unobtrusive to the user. |[1](https://bugzilla.mozilla.org/show_bug.cgi?id=1543986#c4)||2019-11-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 |[1](https://github.com/mozilla-mobile/fenix/pull/5579)||2020-03-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-03-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-03-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-03-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-03-01 |