From d3b0d0b3d48d31c9603251ac615b3707feece26d Mon Sep 17 00:00:00 2001 From: schmanu Date: Thu, 9 Nov 2023 17:38:01 +0100 Subject: [PATCH] fix: additional requested analytics changes --- src/services/analytics/events/mpcWallet.ts | 7 ++++++- src/services/mpc/SocialWalletService.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/services/analytics/events/mpcWallet.ts b/src/services/analytics/events/mpcWallet.ts index 8e20e29de2..53254ead36 100644 --- a/src/services/analytics/events/mpcWallet.ts +++ b/src/services/analytics/events/mpcWallet.ts @@ -10,7 +10,7 @@ export const MPC_WALLET_EVENTS = { }, MANUAL_RECOVERY: { event: EventType.META, - action: 'Account recovery started', + action: 'MFA login started', category: MPC_WALLET_CATEGORY, }, RECOVER_PASSWORD: { @@ -18,6 +18,11 @@ export const MPC_WALLET_EVENTS = { action: 'Recover account using password', category: MPC_WALLET_CATEGORY, }, + RECOVERED_SOCIAL_SIGNER: { + event: EventType.META, + action: 'Recovered social signer', + category: MPC_WALLET_CATEGORY, + }, UPSERT_PASSWORD: { event: EventType.CLICK, action: 'Set or change password', diff --git a/src/services/mpc/SocialWalletService.ts b/src/services/mpc/SocialWalletService.ts index 5f70963f2f..42df3214a7 100644 --- a/src/services/mpc/SocialWalletService.ts +++ b/src/services/mpc/SocialWalletService.ts @@ -45,7 +45,7 @@ class SocialWalletService implements ISocialWalletService { } if (!this.isMFAEnabled()) { - trackEvent(MPC_WALLET_EVENTS.ENABLE_MFA) + trackEvent({ ...MPC_WALLET_EVENTS.ENABLE_MFA, label: 'password' }) // 2. enable MFA in mpcCoreKit await this.mpcCoreKit.enableMFA({}, false) } @@ -128,6 +128,10 @@ class SocialWalletService implements ISocialWalletService { await this.finalizeLogin() } + if (this.mpcCoreKit.status === COREKIT_STATUS.LOGGED_IN) { + trackEvent({ ...MPC_WALLET_EVENTS.RECOVERED_SOCIAL_SIGNER, label: 'password' }) + } + return this.mpcCoreKit.status === COREKIT_STATUS.LOGGED_IN }