For #1298: Adds adjustCampaignId to core ping (#5579)

nightly-build-test
Sawyer Blatz 5 years ago committed by GitHub
parent a0c60c70da
commit 7f328a6dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -410,6 +410,21 @@ metrics:
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
adjust_campaign:
type: string
lifetime: application
description: >
A string containing the Adjust campaign ID from which the user installed Fenix
send_in_pings:
- metrics
bugs:
- 1298
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/5579
notification_emails:
- fenix-core@mozilla.com
expires: "2020-03-01"
search.default_engine:
code:

@ -13,6 +13,7 @@ import com.adjust.sdk.AdjustConfig
import com.adjust.sdk.LogLevel
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.Config
import org.mozilla.fenix.ext.settings
class AdjustMetricsService(private val application: Application) : MetricsService {
override fun start() {
@ -33,6 +34,10 @@ class AdjustMetricsService(private val application: Application) : MetricsServic
true
)
config.setOnAttributionChangedListener {
application.settings().adjustCampaignId = it.campaign
}
config.setLogLevel(LogLevel.SUPRESS)
Adjust.onCreate(config)

@ -40,6 +40,7 @@ import org.mozilla.fenix.GleanMetrics.SyncAuth
import org.mozilla.fenix.GleanMetrics.Tab
import org.mozilla.fenix.GleanMetrics.TrackingProtection
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
private class EventWrapper<T : Enum<T>>(
private val recorder: ((Map<T, String>?) -> Unit),
@ -444,6 +445,7 @@ class GleanMetricsService(private val context: Context) : MetricsService {
defaultMozBrowser.set(it)
}
mozillaProducts.set(MozillaProductDetector.getInstalledMozillaProducts(context))
adjustCampaign.set(context.settings().adjustCampaignId)
}
SearchDefaultEngine.apply {

@ -23,8 +23,8 @@ import org.mozilla.fenix.Config
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.MozillaProductDetector
import org.mozilla.fenix.ext.getPreferenceKey
import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType
import org.mozilla.fenix.settings.PhoneFeature
import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType
import java.security.InvalidParameterException
/**
@ -76,6 +76,11 @@ class Settings private constructor(
override val preferences: SharedPreferences =
appContext.getSharedPreferences(FENIX_PREFERENCES, MODE_PRIVATE)
var adjustCampaignId by stringPreference(
appContext.getPreferenceKey(R.string.pref_key_adjust_campaign),
default = ""
)
var usePrivateMode by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_private_mode),
default = false

@ -104,4 +104,6 @@
<!-- Quick Action Sheet -->
<string name="pref_key_bounce_quick_action" translatable="false">pref_key_bounce_quick_action</string>
<string name="pref_key_reader_mode_notification" translatable="false">pref_key_reader_mode_notification</string>
<string name="pref_key_adjust_campaign" translatable="false">pref_key_adjust_campaign</string>
</resources>

@ -157,6 +157,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.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/TODO)||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 |

Loading…
Cancel
Save