For #981 - Adds missing Leanplum events
parent
e7576b2831
commit
f323c38be0
|
@ -20,31 +20,6 @@ private val Event.name: String?
|
||||||
is Event.OpenedApp -> "E_Opened_App"
|
is Event.OpenedApp -> "E_Opened_App"
|
||||||
is Event.OpenedAppFirstRun -> "E_Opened_App_FirstRun"
|
is Event.OpenedAppFirstRun -> "E_Opened_App_FirstRun"
|
||||||
is Event.InteractWithSearchURLArea -> "E_Interact_With_Search_URL_Area"
|
is Event.InteractWithSearchURLArea -> "E_Interact_With_Search_URL_Area"
|
||||||
is Event.SavedLoginandPassword -> "E_Saved_Login_and_Password"
|
|
||||||
is Event.FXANewSignup -> "E_FXA_New_Signup"
|
|
||||||
is Event.UserSignedInToFxA -> "E_User_Signed_In_To_FxA"
|
|
||||||
is Event.UserDownloadedFocus -> "E_User_Downloaded_Focus"
|
|
||||||
is Event.UserDownloadedLockbox -> "E_User_Downloaded_Lockbox"
|
|
||||||
is Event.UserDownloadedFennec -> "E_User_Downloaded_Fennec"
|
|
||||||
is Event.TrackingProtectionSettingsChanged -> "E_Tracking_Protection_Settings_Changed"
|
|
||||||
is Event.FXASyncedNewDevice -> "E_FXA_Synced_New_Device"
|
|
||||||
is Event.DismissedOnboarding -> "E_Dismissed_Onboarding"
|
|
||||||
is Event.Uninstall -> "E_Uninstall"
|
|
||||||
is Event.OpenNewNormalTab -> "E_Open_New_Normal_Tab"
|
|
||||||
is Event.OpenNewPrivateTab -> "E_Open_New_Private_Tab"
|
|
||||||
is Event.ShareStarted -> "E_Share_Started"
|
|
||||||
is Event.ShareCanceled -> "E_Share_Canceled"
|
|
||||||
is Event.ShareCompleted -> "E_Share_Completed"
|
|
||||||
is Event.ClosePrivateTabs -> "E_Close_Private_Tabs"
|
|
||||||
is Event.ClearedPrivateData -> "E_Cleared_Private_Data"
|
|
||||||
is Event.OpenedLoginManager -> "E_Opened_Login_Manager"
|
|
||||||
is Event.OpenedMailtoLink -> "E_Opened_Mailto_Link"
|
|
||||||
is Event.DownloadMediaSavedImage -> "E_Download_Media_Saved_Image"
|
|
||||||
is Event.UserUsedReaderView -> "E_User_Used_Reader_View"
|
|
||||||
is Event.UserDownloadedPocket -> "E_User_Downloaded_Pocket"
|
|
||||||
is Event.UserDownloadedSend -> "E_User_Downloaded_Send"
|
|
||||||
is Event.OpenedPocketStory -> "E_Opened_Pocket_Story"
|
|
||||||
is Event.DarkModeEnabled -> "E_Dark_Mode_Enabled"
|
|
||||||
|
|
||||||
// Do not track other events in Leanplum
|
// Do not track other events in Leanplum
|
||||||
else -> ""
|
else -> ""
|
||||||
|
@ -85,7 +60,9 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ
|
||||||
Parser.parseVariables(application)
|
Parser.parseVariables(application)
|
||||||
|
|
||||||
LeanplumActivityHelper.enableLifecycleCallbacks(application)
|
LeanplumActivityHelper.enableLifecycleCallbacks(application)
|
||||||
Leanplum.start(application)
|
Leanplum.start(application, hashMapOf(
|
||||||
|
"default_browser" to (MozillaProductDetector.getMozillaBrowserDefault(application) ?: "")
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun stop() {
|
override fun stop() {
|
||||||
|
|
|
@ -125,6 +125,10 @@ class HomeFragment : Fragment(), CoroutineScope, AccountObserver {
|
||||||
sessionObserver = BrowserSessionsObserver(sessionManager, singleSessionObserver) {
|
sessionObserver = BrowserSessionsObserver(sessionManager, singleSessionObserver) {
|
||||||
emitSessionChanges()
|
emitSessionChanges()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!onboarding.userHasBeenOnboarded()) {
|
||||||
|
requireComponents.analytics.metrics.track(Event.OpenedAppFirstRun)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
|
|
|
@ -6,6 +6,8 @@ package org.mozilla.fenix.onboarding
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import org.mozilla.fenix.components.metrics.Event
|
||||||
|
import org.mozilla.fenix.ext.components
|
||||||
|
|
||||||
class FenixOnboarding(private val context: Context) {
|
class FenixOnboarding(private val context: Context) {
|
||||||
private val onboardingPrefs = context.applicationContext.getSharedPreferences(
|
private val onboardingPrefs = context.applicationContext.getSharedPreferences(
|
||||||
|
@ -19,6 +21,7 @@ class FenixOnboarding(private val context: Context) {
|
||||||
|
|
||||||
fun finish() {
|
fun finish() {
|
||||||
onboardingPrefs.onboardedVersion = CURRENT_ONBOARDING_VERSION
|
onboardingPrefs.onboardedVersion = CURRENT_ONBOARDING_VERSION
|
||||||
|
context.components.analytics.metrics.track(Event.DismissedOnboarding)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun userHasBeenOnboarded(): Boolean {
|
fun userHasBeenOnboarded(): Boolean {
|
||||||
|
|
|
@ -69,6 +69,8 @@ class SearchFragment : Fragment(), BackHandler {
|
||||||
// TransitionInflater.from(context).inflateTransition(android.R.transition.move).setDuration(
|
// TransitionInflater.from(context).inflateTransition(android.R.transition.move).setDuration(
|
||||||
// SHARED_TRANSITION_MS
|
// SHARED_TRANSITION_MS
|
||||||
// )
|
// )
|
||||||
|
|
||||||
|
requireComponents.analytics.metrics.track(Event.InteractWithSearchURLArea)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
|
|
Loading…
Reference in New Issue