-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure marketing consent is explicitly tracked as boolean #12926
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Bitrise❌❌❌ Commit hash: 87e744c Note
Tip
|
metrics.trackEvent( | ||
metrics | ||
.createEventBuilder(MetaMetricsEvents.ANALYTICS_PREFERENCE_SELECTED) | ||
.addProperties({ | ||
...dataCollectionForMarketingTraits, | ||
is_metrics_opted_in: true, | ||
location: 'onboarding_metametrics', | ||
updated_after_onboarding: false, | ||
}) | ||
.build(), | ||
); | ||
|
||
// trait indicating if user opts in for data collection for marketing | ||
let dataCollectionForMarketingTraits; | ||
if (this.props.isDataCollectionForMarketingEnabled) { | ||
dataCollectionForMarketingTraits = { has_marketing_consent: true }; | ||
} | ||
await metrics.enable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can not work if you track the event before await metrics.enable();
.
The tracking will be skipped.
Bitrise❌❌❌ Commit hash: 82199aa Note
Tip
|
…metamask-mobile into marketing-consent-tracking-bug
Bitrise🔄🔄🔄 Commit hash: 38f1ecc Note
|
Bitrise❌❌❌ Commit hash: 6954b0c Note
Tip
|
Quality Gate passedIssues Measures |
Description
Currently, when users decline marketing consent during onboarding, the
has_marketing_consent
property is not being set at all in the analytics. This creates inconsistent data where we can't properly track users who explicitly opted out of marketing.This PR modifies the OptinMetrics component to explicitly set
has_marketing_consent
to eithertrue
orfalse
based on the user's choice, ensuring we have complete analytics data for all user decisions regarding marketing consent.Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2086
Manual testing steps
has_marketing_consent
is properly set tofalse
in first case andtrue
in second caseScreenshots/Recordings
Before
Analytics data missing
has_marketing_consent
property when user declines marketing consentAfter
Analytics data showing explicit
has_marketing_consent: false
when user declines marketing consentPre-merge author checklist
Pre-merge reviewer checklist