From 6a7a29fc61437a0e255d2b767b7013f05b3a6a87 Mon Sep 17 00:00:00 2001 From: jhugman Date: Thu, 16 Jul 2020 16:09:32 +0000 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/11704 Add leanplum attributes for tracking protection (https://github.com/mozilla-mobile/fenix/pull/11965) r=sblatz * For 11657: add LP attribute for tracking protection * For https://github.com/mozilla-mobile/fenix/issues/11704: added tracking_protection_enabled attribute * Added docs for the new attributes, linking to data-review to the mma.md * Rename null to none when no ETP is enabled --- .../components/metrics/LeanplumMetricsService.kt | 11 +++++++++++ docs/mma.md | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt index d3aa0c8c38..fd00fd9ef9 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt @@ -102,6 +102,15 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ val installedApps = MozillaProductDetector.getInstalledMozillaProducts(application) + val trackingProtection = application.settings().run { + when { + !shouldUseTrackingProtection -> "none" + useStandardTrackingProtection -> "standard" + useStrictTrackingProtection -> "strict" + else -> "custom" + } + } + Leanplum.start(application, hashMapOf( "default_browser" to MozillaProductDetector.getMozillaBrowserDefault(application).orEmpty(), "fennec_installed" to installedApps.contains(MozillaProducts.FIREFOX.productName), @@ -110,6 +119,8 @@ class LeanplumMetricsService(private val application: Application) : MetricsServ "fxa_signed_in" to application.settings().fxaSignedIn, "fxa_has_synced_items" to application.settings().fxaHasSyncedItems, "search_widget_installed" to application.settings().searchWidgetInstalled, + "tracking_protection_enabled" to application.settings().shouldUseTrackingProtection, + "tracking_protection_setting" to trackingProtection, "fenix" to true )) diff --git a/docs/mma.md b/docs/mma.md index 32166284b4..1340ff1052 100644 --- a/docs/mma.md +++ b/docs/mma.md @@ -144,6 +144,16 @@ User Attributes A boolean indicating that the user has at least one search widget placed on the home screen #4694 + + `tracking_protection_enabled` + A boolean indicating that the user has enabled tracking protection + #11965 + + + `tracking_protection_setting` + A string indicating the level at which the user has set tracking protection. Possible values are `none`, `standard`, `strict` and `custom` + #11965 + `fenix` A boolean indicating that this is a Fenix installation