diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-12-21 07:05:54 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-12-21 07:05:54 +0800 |
commit | b399aa25aa9386d388d31edb463e803c7c31a2db (patch) | |
tree | bf5a7495a38b0b3eea7041b4f3ccf2b8b5b5bb7e /packages | |
parent | 7c7085c9328ce41c97469dc50232737814a7b95f (diff) | |
download | dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.tar dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.tar.gz dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.tar.bz2 dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.tar.lz dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.tar.xz dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.tar.zst dexon-sol-tools-b399aa25aa9386d388d31edb463e803c7c31a2db.zip |
feat(instant): add new event for unknown buy errors
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 2 | ||||
-rw-r--r-- | packages/instant/src/util/analytics.ts | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 46d121611..5c9c28ae4 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -93,7 +93,7 @@ export class BuyButton extends React.Component<BuyButtonProps> { return; } else { errorReporter.report(e); - analytics.trackBuySignatureDenied(buyQuote); + analytics.trackBuyUnknownError(buyQuote, e.message); this.props.onValidationFail(buyQuote, ZeroExInstantError.CouldNotSubmitTransaction); return; } diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index e6128f857..21d3a4d9e 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -44,6 +44,7 @@ enum EventNames { BUY_STARTED = 'Buy - Started', BUY_SIGNATURE_DENIED = 'Buy - Signature Denied', BUY_SIMULATION_FAILED = 'Buy - Simulation Failed', + BUY_UNKNOWN_ERROR = 'Buy - Unknown Error', BUY_TX_SUBMITTED = 'Buy - Tx Submitted', BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded', BUY_TX_FAILED = 'Buy - Tx Failed', @@ -181,6 +182,11 @@ export const analytics = { trackingEventFnWithPayload(EventNames.BUY_SIGNATURE_DENIED)(buyQuoteEventProperties(buyQuote)), trackBuySimulationFailed: (buyQuote: BuyQuote) => trackingEventFnWithPayload(EventNames.BUY_SIMULATION_FAILED)(buyQuoteEventProperties(buyQuote)), + trackBuyUnknownError: (buyQuote: BuyQuote, errorMessage: string) => + trackingEventFnWithPayload(EventNames.BUY_UNKNOWN_ERROR)({ + ...buyQuoteEventProperties(buyQuote), + errorMessage, + }), trackBuyTxSubmitted: (buyQuote: BuyQuote, txHash: string, startTimeUnix: number, expectedEndTimeUnix: number) => trackingEventFnWithPayload(EventNames.BUY_TX_SUBMITTED)({ ...buyQuoteEventProperties(buyQuote), |