Skip to content

Commit

Permalink
fix(analytics): reset account event
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Aug 31, 2021
1 parent 3bb1133 commit e6e3493
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,8 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
analytics.push(AnalyticsKey.ACCOUNT_PASSWORD_RESET, {
properties: {
guid,
originalTimestamp: getOriginalTimestamp()
originalTimestamp: getOriginalTimestamp(),
site_redirect: 'WALLET'
},
traits: {
email,
Expand All @@ -2979,6 +2980,7 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
})
break
}
// TODO - every time code is scanned, can we distinguish if for recovery or not?
case AT.auth.SECURE_CHANNEL_LOGIN_LOADING: {
const state = store.getState()
const nabuId = state.profile.userData.getOrElse({})?.id ?? null
Expand All @@ -2990,7 +2992,8 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
analytics.push(AnalyticsKey.CLOUD_BACKUP_CODE_SCANNED, {
properties: {
guid,
originalTimestamp: getOriginalTimestamp()
originalTimestamp: getOriginalTimestamp(),
site_redirect: 'WALLET'
},
traits: {
email,
Expand All @@ -3011,7 +3014,8 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
analytics.push(AnalyticsKey.NEW_ACCOUNT_PASSWORD_ENTERED, {
properties: {
guid,
originalTimestamp: getOriginalTimestamp()
originalTimestamp: getOriginalTimestamp(),
site_redirect: 'WALLET'
},
traits: {
email,
Expand All @@ -3035,7 +3039,8 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
properties: {
guid,
originalTimestamp: getOriginalTimestamp(),
recovery_type: recoveryType
recovery_type: recoveryType,
site_redirect: 'WALLET'
},
traits: {
email,
Expand All @@ -3058,7 +3063,8 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
analytics.push(AnalyticsKey.RECOVERY_PHRASE_ENTERED, {
properties: {
guid,
originalTimestamp: getOriginalTimestamp()
originalTimestamp: getOriginalTimestamp(),
site_redirect: 'WALLET'
},
traits: {
email,
Expand All @@ -3076,13 +3082,14 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
: null
const tier = state.profile.userData.getOrElse({})?.tiers?.current ?? null
const guid = state.walletPath.wallet.guid ?? null
const { origin } = action.paylpad
const { origin } = action.payload

analytics.push(AnalyticsKey.RESET_ACCOUNT_CANCELLED, {
properties: {
guid,
origin,
originalTimestamp: getOriginalTimestamp()
originalTimestamp: getOriginalTimestamp(),
site_redirect: 'WALLET'
},
traits: {
email,
Expand All @@ -3100,13 +3107,14 @@ const analyticsMiddleware = () => (store) => (next) => (action) => {
: null
const tier = state.profile.userData.getOrElse({})?.tiers?.current ?? null
const guid = state.walletPath.wallet.guid ?? null
const { origin } = action.paylpad
const { origin } = action.payload

analytics.push(AnalyticsKey.RESET_ACCOUNT_CLICKED, {
properties: {
guid,
origin,
originalTimestamp: getOriginalTimestamp()
originalTimestamp: getOriginalTimestamp(),
site_redirect: 'WALLET'
},
traits: {
email,
Expand Down

0 comments on commit e6e3493

Please sign in to comment.