Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Remove banner open in app telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Elise Richards authored and mergify[bot] committed Aug 31, 2021
1 parent c962601 commit 6cb872c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 73 deletions.
44 changes: 0 additions & 44 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4459,50 +4459,6 @@ tabs:
- [email protected]
expires: "2022-02-01"

banner_open_in_app:
displayed:
type: event
description: |
Open in App banner was shown.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/16828
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/17049
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-08-01"
dismissed:
type: event
description: |
User tapped 'dismiss' on Open in App banner.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/16828
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/17049
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-08-01"
go_to_settings:
type: event
description: |
User tapped 'go to settings' on Open in App banner.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/16828
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/17049
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
data_sensitivity:
- interaction
notification_emails:
- [email protected]
expires: "2021-08-01"

contextual_menu:
copy_tapped:
type: event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifAnyChanged
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.infobanner.DynamicInfoBanner
import org.mozilla.fenix.browser.infobanner.InfoBanner
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.Event.BannerOpenInAppGoToSettings
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.utils.Settings

Expand Down Expand Up @@ -93,7 +90,6 @@ class OpenInAppOnboardingObserver(
infoBanner?.showBanner()
sessionDomainForDisplayedBanner = url.tryGetHostFromUrl()
settings.shouldShowOpenInAppBanner = false
context.components.analytics.metrics.track(Event.BannerOpenInAppDisplayed)
}
}

Expand All @@ -105,18 +101,12 @@ class OpenInAppOnboardingObserver(
dismissText = context.getString(R.string.open_in_app_cfr_negative_button_text),
actionText = context.getString(R.string.open_in_app_cfr_positive_button_text),
container = container,
shouldScrollWithTopToolbar = shouldScrollWithTopToolbar,
dismissAction = ::dismissAction
shouldScrollWithTopToolbar = shouldScrollWithTopToolbar
) {
val directions = BrowserFragmentDirections.actionBrowserFragmentToSettingsFragment(
preferenceToScrollTo = context.getString(R.string.pref_key_open_links_in_external_app)
)
context.components.analytics.metrics.track(BannerOpenInAppGoToSettings)
navController.nav(R.id.browserFragment, directions)
}
}

private fun dismissAction() {
context.components.analytics.metrics.track(Event.BannerOpenInAppDismissed)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@ sealed class Event {
object HaveOpenTabs : Event()
object HaveNoOpenTabs : Event()

object BannerOpenInAppDisplayed : Event()
object BannerOpenInAppDismissed : Event()
object BannerOpenInAppGoToSettings : Event()

object ContextMenuCopyTapped : Event()
object ContextMenuSearchTapped : Event()
object ContextMenuSelectAllTapped : Event()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.mozilla.fenix.GleanMetrics.AndroidKeystoreExperiment
import org.mozilla.fenix.GleanMetrics.AppTheme
import org.mozilla.fenix.GleanMetrics.Autoplay
import org.mozilla.fenix.GleanMetrics.Awesomebar
import org.mozilla.fenix.GleanMetrics.BannerOpenInApp
import org.mozilla.fenix.GleanMetrics.BookmarksManagement
import org.mozilla.fenix.GleanMetrics.BrowserSearch
import org.mozilla.fenix.GleanMetrics.Collections
Expand Down Expand Up @@ -642,15 +641,6 @@ private val Event.wrapper: EventWrapper<*>?
Event.HaveNoOpenTabs -> EventWrapper<NoExtraKeys>(
{ Metrics.hasOpenTabs.set(false) }
)
is Event.BannerOpenInAppDisplayed -> EventWrapper<NoExtraKeys>(
{ BannerOpenInApp.displayed.record(it) }
)
is Event.BannerOpenInAppDismissed -> EventWrapper<NoExtraKeys>(
{ BannerOpenInApp.dismissed.record(it) }
)
is Event.BannerOpenInAppGoToSettings -> EventWrapper<NoExtraKeys>(
{ BannerOpenInApp.goToSettings.record(it) }
)
is Event.SyncedTabSuggestionClicked -> EventWrapper<NoExtraKeys>(
{ SyncedTabs.syncedTabsSuggestionClicked.record(it) }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import androidx.navigation.NavController
import io.mockk.every
import io.mockk.just
import io.mockk.mockk
import io.mockk.runs
import io.mockk.spyk
import io.mockk.verify
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand All @@ -35,7 +33,6 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.browser.infobanner.DynamicInfoBanner
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
import org.mozilla.fenix.utils.Settings

Expand Down Expand Up @@ -150,7 +147,7 @@ class OpenInAppOnboardingObserverTest {
every { settings.openLinksInExternalApp } returns false
every { settings.shouldShowOpenInAppCfr } returns true
every { appLinksUseCases.appLinkRedirect.invoke(any()).hasExternalApp() } returns true
every { context.components.analytics.metrics.track(any()) } just runs

store.dispatch(ContentAction.UpdateLoadingStateAction("1", true)).joinBlocking()

openInAppOnboardingObserver.start()
Expand Down

0 comments on commit 6cb872c

Please sign in to comment.