Skip to content

Commit

Permalink
updated analytics preferences are not logging during onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
NidhiKJha committed Dec 3, 2024
1 parent 589d7e4 commit 1b2fb47
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions ui/pages/onboarding-flow/metametrics/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
setDataCollectionForMarketing,
} from '../../../store/actions';
import {
getParticipateInMetaMetrics,
getDataCollectionForMarketing,
getFirstTimeFlowType,
getFirstTimeFlowTypeRouteAfterMetaMetricsOptIn,
Expand Down Expand Up @@ -53,7 +52,6 @@ export default function OnboardingMetametrics() {
const firstTimeFlowType = useSelector(getFirstTimeFlowType);

const dataCollectionForMarketing = useSelector(getDataCollectionForMarketing);
const participateInMetaMetrics = useSelector(getParticipateInMetaMetrics);

const trackEvent = useContext(MetaMetricsContext);

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1b2fb47

Please sign in to comment.