aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/analytics.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-11-22 02:22:43 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-11-27 06:48:07 +0800
commit685d83d6d0dc7998ce231e5106d74c0e16b17f34 (patch)
tree6988fa9813bd7b7ff142b230c401ad9d3d91882e /packages/instant/src/util/analytics.ts
parent825911ed89e63f065c1a843ad83fb28ed72bb8ee (diff)
downloaddexon-0x-contracts-685d83d6d0dc7998ce231e5106d74c0e16b17f34.tar.gz
dexon-0x-contracts-685d83d6d0dc7998ce231e5106d74c0e16b17f34.tar.zst
dexon-0x-contracts-685d83d6d0dc7998ce231e5106d74c0e16b17f34.zip
feat(instant): implement buy events without associated properties
Diffstat (limited to 'packages/instant/src/util/analytics.ts')
-rw-r--r--packages/instant/src/util/analytics.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index e389e1530..bd3a62ef8 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -18,6 +18,13 @@ enum EventNames {
ACCOUNT_UNLOCK_REQUESTED = 'Account - Unlock Requested',
ACCOUNT_UNLOCK_DENIED = 'Account - Unlock Denied',
ACCOUNT_ADDRESS_CHANGED = 'Account - Address Changed',
+ BUY_NOT_ENOUGH_ETH = 'Buy - Not Enough Eth',
+ BUY_STARTED = 'Buy - Started',
+ BUY_SIGNATURE_DENIED = 'Buy - Signature Denied',
+ BUY_SIMULATION_FAILED = 'Buy - Simulation Failed',
+ BUY_TX_SUBMITTED = 'Buy - Tx Submitted',
+ BUY_TX_SUCCEEDED = 'Buy - Tx Succeeded',
+ BUY_TX_FAILED = 'Buy - Tx Failed',
}
const track = (eventName: EventNames, eventProperties: EventProperties = {}): void => {
evaluateIfEnabled(() => {
@@ -67,4 +74,11 @@ export const analytics = {
trackAccountUnlockDenied: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_DENIED),
trackAccountAddressChanged: (address: string) =>
trackingEventFnWithPayload(EventNames.ACCOUNT_ADDRESS_CHANGED)({ address }),
+ trackBuyNotEnoughEth: trackingEventFnWithoutPayload(EventNames.BUY_NOT_ENOUGH_ETH),
+ trackBuyStarted: trackingEventFnWithoutPayload(EventNames.BUY_STARTED),
+ trackBuySignatureDenied: trackingEventFnWithoutPayload(EventNames.BUY_SIGNATURE_DENIED),
+ trackBuySimulationFailed: trackingEventFnWithoutPayload(EventNames.BUY_SIMULATION_FAILED),
+ trackBuyTxSubmitted: trackingEventFnWithoutPayload(EventNames.BUY_TX_SUBMITTED),
+ trackBuyTxSucceeded: trackingEventFnWithoutPayload(EventNames.BUY_TX_SUCCEEDED),
+ trackBuyTxFailed: trackingEventFnWithoutPayload(EventNames.BUY_TX_FAILED),
};