1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Fix #17669 - Revise old metrics schema for Onboarding v2 (#17769)

This commit is contained in:
David Walsh 2023-02-16 10:06:56 -06:00 committed by GitHub
parent 9979020252
commit cf49761d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 57 deletions

View File

@ -283,7 +283,7 @@ export const EVENT_NAMES = {
ACCOUNT_ADDED: 'Account Added',
ACCOUNT_ADD_SELECTED: 'Account Add Selected',
ACCOUNT_ADD_FAILED: 'Account Add Failed',
ACCOUNT_PASSWORD_CREATED: 'Wallet Password Created',
ACCOUNT_PASSWORD_CREATED: 'Account Password Created',
ACCOUNT_RESET: 'Account Reset',
APP_INSTALLED: 'App Installed',
APP_UNLOCKED: 'App Unlocked',
@ -356,15 +356,13 @@ export const EVENT_NAMES = {
ONBOARDING_WALLET_SECURITY_SKIP_INITIATED: 'SRP Skip Backup Selected',
ONBOARDING_WALLET_SECURITY_SKIP_CONFIRMED: 'SRP Backup Skipped',
ONBOARDING_WALLET_SECURITY_SKIP_CANCELED: 'SRP Skip Backup Canceled',
ONBOARDING_WALLET_SECURITY_PHRASE_REVEALED: 'Key Material Revealed',
ONBOARDING_WALLET_SECURITY_PHRASE_REVEALED: 'SRP Revealed',
ONBOARDING_WALLET_SECURITY_PHRASE_WRITTEN_DOWN: 'SRP Backup Confirm Display',
ONBOARDING_WALLET_SECURITY_PHRASE_CONFIRMED: 'SRP Backup Confirmed',
ONBOARDING_WALLET_CREATION_COMPLETE: 'Wallet Created',
ONBOARDING_WALLET_IMPORT_COMPLETE: 'Wallet Imported',
ONBOARDING_WALLET_SETUP_COMPLETE: 'Application Opened',
ONBOARDING_WALLET_ADVANCED_SETTINGS: 'Settings Updated',
ONBOARDING_WALLET_IMPORT_ATTEMPTED: 'Wallet Import Attempted',
ONBOARDING_WALLET_METRICS_PREFENCE_SELECTED: 'Analytics Preferences Selected',
ONBOARDING_WALLET_VIDEO_PLAY: 'SRP Intro Video Played',
ONBOARDING_TWITTER_CLICK: 'External Link Clicked',
};

View File

@ -19,7 +19,6 @@ import {
import { isBeta } from '../../../helpers/utils/build-types';
import { getFirstTimeFlowType } from '../../../selectors';
import { EVENT_NAMES, EVENT } from '../../../../shared/constants/metametrics';
import { FIRST_TIME_FLOW_TYPES } from '../../../helpers/constants/onboarding';
import { MetaMetricsContext } from '../../../contexts/metametrics';
export default function CreationSuccessful() {
@ -103,10 +102,7 @@ export default function CreationSuccessful() {
onClick={() => {
trackEvent({
category: EVENT.CATEGORIES.ONBOARDING,
event:
firstTimeFlowType === FIRST_TIME_FLOW_TYPES.IMPORT
? EVENT_NAMES.ONBOARDING_WALLET_IMPORT_COMPLETE
: EVENT_NAMES.ONBOARDING_WALLET_CREATION_COMPLETE,
event: EVENT_NAMES.ONBOARDING_WALLET_CREATION_COMPLETE,
properties: {
method: firstTimeFlowType,
},

View File

@ -14,7 +14,6 @@ import { setParticipateInMetaMetrics } from '../../../store/actions';
import {
getFirstTimeFlowTypeRoute,
getFirstTimeFlowType,
getParticipateInMetaMetrics,
} from '../../../selectors';
import { EVENT, EVENT_NAMES } from '../../../../shared/constants/metametrics';
@ -29,31 +28,11 @@ export default function OnboardingMetametrics() {
const nextRoute = useSelector(getFirstTimeFlowTypeRoute);
const firstTimeFlowType = useSelector(getFirstTimeFlowType);
const participateInMetaMetrics = useSelector(getParticipateInMetaMetrics);
const trackEvent = useContext(MetaMetricsContext);
const onConfirm = async () => {
const [, metaMetricsId] = await dispatch(setParticipateInMetaMetrics(true));
const isInitiallyNotParticipating = !participateInMetaMetrics;
try {
if (isInitiallyNotParticipating) {
trackEvent(
{
category: EVENT.CATEGORIES.ONBOARDING,
event: EVENT_NAMES.ONBOARDING_WALLET_METRICS_PREFENCE_SELECTED,
properties: {
is_metrics_enabled: true,
},
},
{
isOptIn: true,
flushImmediately: true,
},
);
}
trackEvent(
{
category: EVENT.CATEGORIES.ONBOARDING,
@ -78,29 +57,7 @@ export default function OnboardingMetametrics() {
const onCancel = async () => {
await dispatch(setParticipateInMetaMetrics(false));
const isInitiallyParticipatingOrNotSet =
participateInMetaMetrics === null || participateInMetaMetrics;
try {
if (isInitiallyParticipatingOrNotSet) {
trackEvent(
{
category: EVENT.CATEGORIES.ONBOARDING,
event: EVENT_NAMES.ONBOARDING_WALLET_METRICS_PREFENCE_SELECTED,
properties: {
is_metrics_enabled: false,
},
},
{
isOptIn: true,
flushImmediately: true,
},
);
}
} finally {
history.push(nextRoute);
}
history.push(nextRoute);
};
return (

View File

@ -177,10 +177,6 @@ export function getCurrentKeyring(state) {
return keyring;
}
export function getParticipateInMetaMetrics(state) {
return Boolean(state.metamask.participateInMetaMetrics);
}
export function isEIP1559Account() {
return true;
}