From 1b2fb470f83fedc1a0cd7f4b6cccd16fda1915c1 Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Tue, 3 Dec 2024 19:49:40 +0000 Subject: [PATCH] updated analytics preferences are not logging during onboarding --- .../metametrics/metametrics.js | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/ui/pages/onboarding-flow/metametrics/metametrics.js b/ui/pages/onboarding-flow/metametrics/metametrics.js index 242638b08c5e..3a36ea90bb14 100644 --- a/ui/pages/onboarding-flow/metametrics/metametrics.js +++ b/ui/pages/onboarding-flow/metametrics/metametrics.js @@ -17,7 +17,6 @@ import { setDataCollectionForMarketing, } from '../../../store/actions'; import { - getParticipateInMetaMetrics, getDataCollectionForMarketing, getFirstTimeFlowType, getFirstTimeFlowTypeRouteAfterMetaMetricsOptIn, @@ -53,7 +52,6 @@ export default function OnboardingMetametrics() { const firstTimeFlowType = useSelector(getFirstTimeFlowType); const dataCollectionForMarketing = useSelector(getDataCollectionForMarketing); - const participateInMetaMetrics = useSelector(getParticipateInMetaMetrics); const trackEvent = useContext(MetaMetricsContext); @@ -82,22 +80,20 @@ export default function OnboardingMetametrics() { }, ); - if (participateInMetaMetrics) { - trackEvent({ - category: MetaMetricsEventCategory.Onboarding, - event: MetaMetricsEventName.AppInstalled, - }); + trackEvent({ + category: MetaMetricsEventCategory.Onboarding, + event: MetaMetricsEventName.AppInstalled, + }); - trackEvent({ - category: MetaMetricsEventCategory.Onboarding, - event: MetaMetricsEventName.AnalyticsPreferenceSelected, - properties: { - is_metrics_opted_in: true, - has_marketing_consent: Boolean(dataCollectionForMarketing), - location: 'onboarding_metametrics', - }, - }); - } + trackEvent({ + category: MetaMetricsEventCategory.Onboarding, + event: MetaMetricsEventName.AnalyticsPreferenceSelected, + properties: { + is_metrics_opted_in: true, + has_marketing_consent: Boolean(dataCollectionForMarketing), + location: 'onboarding_metametrics', + }, + }); } finally { history.push(nextRoute); }