Skip to content

Commit

Permalink
Fix has_marketing_consent flag on metametrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jonybur committed Nov 28, 2024
1 parent 9b067c8 commit 7e9a788
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/pages/settings/security-tab/security-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,15 @@ export default class SecurityTab extends PureComponent {
<ToggleButton
value={dataCollectionForMarketing}
onToggle={(value) => {
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',
},
});
Expand Down

0 comments on commit 7e9a788

Please sign in to comment.