aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-12-21 07:05:54 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-12-21 07:05:54 +0800
commitb399aa25aa9386d388d31edb463e803c7c31a2db (patch)
treebf5a7495a38b0b3eea7041b4f3ccf2b8b5b5bb7e
parent7c7085c9328ce41c97469dc50232737814a7b95f (diff)
downloaddexon-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
-rw-r--r--packages/instant/src/components/buy_button.tsx2
-rw-r--r--packages/instant/src/util/analytics.ts6
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),