From 7e9a7886ef5f4959a8f82fb62401d661a9baf2c3 Mon Sep 17 00:00:00 2001 From: Jonathan Bursztyn Date: Thu, 28 Nov 2024 17:01:21 +0000 Subject: [PATCH] Fix has_marketing_consent flag on metametrics --- ui/pages/settings/security-tab/security-tab.component.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/pages/settings/security-tab/security-tab.component.js b/ui/pages/settings/security-tab/security-tab.component.js index f9e854ff2465..fe9785f5e4c1 100644 --- a/ui/pages/settings/security-tab/security-tab.component.js +++ b/ui/pages/settings/security-tab/security-tab.component.js @@ -381,14 +381,15 @@ export default class SecurityTab extends PureComponent { { - setDataCollectionForMarketing(!value); + const newMarketingConsent = Boolean(!value); + setDataCollectionForMarketing(newMarketingConsent); if (participateInMetaMetrics) { this.context.trackEvent({ category: MetaMetricsEventCategory.Settings, event: MetaMetricsEventName.AnalyticsPreferenceSelected, properties: { is_metrics_opted_in: true, - has_marketing_consent: false, + has_marketing_consent: Boolean(newMarketingConsent), location: 'Settings', }, });