Skip to content

Commit

Permalink
fix(tracking): custodial vs. nc sell tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Dec 28, 2020
1 parent 70db4fd commit 5015caf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ const getPayloadObjectForStep = (payload: StepActionsPayload) => {
displayBack: payload.displayBack,
addBank: payload.addBank
}
case 'PREVIEW_SELL': {
return { step: payload.step, sellOrderType: payload.sellOrderType }
}
case 'CHECKOUT_CONFIRM':
case 'ORDER_SUMMARY':
case 'CANCEL_ORDER':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,15 @@ export type StepActionsPayload =
step: 'PAYMENT_METHODS'
}
| { order?: SBOrderType; step: '3DS_HANDLER' }
| {
sellOrderType?: 'ACCOUNT' | 'CUSTODIAL'
step: 'PREVIEW_SELL'
}
| {
step:
| 'ADD_CARD'
| 'CC_BILLING_ADDRESS'
| 'KYC_REQUIRED'
| 'PREVIEW_SELL'
| 'UPGRADE_TO_GOLD'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,26 @@ const sanitizeEvent = (
fiatCurrency: sbAction.fiatCurrency,
pair: sbAction.pair ? sbAction.pair.pair : '',
side: sbAction.orderType,
sellOrderType: sbAction.swapAccount?.type,
step: sbAction.step
})
]
case 'PREVIEW_SELL':
return [
nextCategory,
formatEvent({
step: sbAction.step,
sellOrderType: sbAction.sellOrderType
})
]
case 'SELL_ORDER_SUMMARY':
return [
nextCategory,
formatEvent({
step: sbAction.step,
sellOrderType: sbAction.sellOrder.kind.direction
})
]
default:
return [nextCategory, formatEvent(sbAction.step)]
}
Expand Down Expand Up @@ -160,8 +177,7 @@ const matomoMiddleware = () => () => next => action => {
!equals(nextEvent, lastEvent) &&
!includes(nextAction, EVENT_ACTION_BLACKLIST)
) {
// console.info('EVENT', nextEvent)
// uncomment to assist with debugging
// console.info('EVENT', nextEvent) // uncomment to assist with debugging
const frame = document.getElementById('matomo-iframe')
frame &&
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ class Checkout extends PureComponent<Props> {
// TODO: sell
// need to do kyc check
if (formValues?.orderType === 'SELL') {
return this.props.simpleBuyActions.setStep({ step: 'PREVIEW_SELL' })
return this.props.simpleBuyActions.setStep({
step: 'PREVIEW_SELL',
sellOrderType: this.props.swapAccount?.type
})
}

if (isSddFlow) {
Expand Down

0 comments on commit 5015caf

Please sign in to comment.