Skip to content

Commit

Permalink
fix(sb): sb matomo event cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip London committed Aug 13, 2020
1 parent 890a493 commit 1f0e2b0
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { equals, includes, path, prop } from 'ramda'

import { StepActionsPayload } from 'data/types'

const PAYLOAD = ['payload']
const NAME = ['payload', 'name']
const TYPE = ['payload', 'type']
Expand Down Expand Up @@ -45,6 +47,25 @@ const sanitizeEvent = (
switch (nextCategory) {
case '@@router/LOCATION_CHANGE':
return [nextCategory, formatEvent(nextAction.split('/')[1])]
case '@EVENT.KYC.UPDATE_EMAIL':
return [nextCategory]
case '@EVENT.SET_SB_STEP':
const sbAction = nextAction as StepActionsPayload
switch (sbAction.step) {
case 'ORDER_SUMMARY':
case 'CHECKOUT_CONFIRM':
return [
nextCategory,
formatEvent({
step: sbAction.step,
inputCurrency: sbAction.order.inputCurrency,
outputCurrency: sbAction.order.outputCurrency,
paymentType: sbAction.order.paymentType
})
]
default:
return [nextCategory, formatEvent(sbAction.step)]
}
default:
return [nextCategory, formatEvent(nextAction), formatEvent(nextName)]
}
Expand Down

0 comments on commit 1f0e2b0

Please sign in to comment.