Bug 1823492 - Add timespan metric for Adjust attribution

fenix/117.0
Roger Yang 11 months ago committed by mergify[bot]
parent c7f1cc4f3d
commit a5a373d2ec

@ -7256,6 +7256,28 @@ first_session:
tags:
- Performance
- Attribution
adjust_attribution_timespan:
type: timespan
time_unit: millisecond
send_in_pings:
- first-session
- metrics
description: >
The time that it takes to derive the attribution parameters by
the Adjust SDK.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1823492
data_reviews:
- https://github.com/mozilla-mobile/firefox-android/pull/2974
data_sensitivity:
- technical
notification_emails:
- android-probes@mozilla.com
expires: 124
metadata:
tags:
- Performance
- Attribution
play_store_attribution:
source:
type: string

@ -51,8 +51,13 @@ class AdjustMetricsService(
val installationPing = FirstSessionPing(application)
FirstSession.adjustAttributionTimespan.start()
val timerId = FirstSession.adjustAttributionTime.start()
config.setOnAttributionChangedListener {
if (!installationPing.wasAlreadyTriggered()) {
FirstSession.adjustAttributionTimespan.stop()
}
FirstSession.adjustAttributionTime.stopAndAccumulate(timerId)
if (!it.network.isNullOrEmpty()) {
application.applicationContext.settings().adjustNetwork =
@ -81,6 +86,7 @@ class AdjustMetricsService(
}
override fun stop() {
FirstSession.adjustAttributionTimespan.cancel()
Adjust.setEnabled(false)
Adjust.gdprForgetMe(application.applicationContext)
}

@ -35,7 +35,6 @@ class FirstSessionPing(private val context: Context) {
*
* @return true if it was already triggered, false otherwise.
*/
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
internal fun wasAlreadyTriggered(): Boolean {
return prefs.getBoolean("ping_sent", false)
}

Loading…
Cancel
Save