diff options
author | Steve Klebanoff <steve@0xproject.com> | 2018-12-01 04:52:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-01 04:52:06 +0800 |
commit | f8daacc19aef4a2c0920e8b5dad87af7b8b12196 (patch) | |
tree | 9c5c10d8b0e51fb1ef869b6ea880605ca589fb76 /packages/instant/src/util/analytics.ts | |
parent | f496096ce154e51ae0317cc91fd55d062eb6ec4f (diff) | |
parent | 6c941eebeae4828177b0d195168f5f1b757432e2 (diff) | |
download | dexon-0x-contracts-f8daacc19aef4a2c0920e8b5dad87af7b8b12196.tar.gz dexon-0x-contracts-f8daacc19aef4a2c0920e8b5dad87af7b8b12196.tar.zst dexon-0x-contracts-f8daacc19aef4a2c0920e8b5dad87af7b8b12196.zip |
Merge pull request #1342 from 0xProject/feature/instant/misc-close-analytics
[instant] Close and View Transaction analytics events
Diffstat (limited to 'packages/instant/src/util/analytics.ts')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index 4b8aff4c9..714ff8bcd 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -6,6 +6,7 @@ import { AffiliateInfo, Asset, Network, + OrderProcessState, OrderSource, ProviderState, QuoteFetchOrigin, @@ -27,6 +28,7 @@ export const evaluateIfEnabled = (fnCall: () => void) => { enum EventNames { INSTANT_OPENED = 'Instant - Opened', + INSTANT_CLOSED = 'Instant - Closed', ACCOUNT_LOCKED = 'Account - Locked', ACCOUNT_READY = 'Account - Ready', ACCOUNT_UNLOCK_REQUESTED = 'Account - Unlock Requested', @@ -51,6 +53,7 @@ enum EventNames { TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed', TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose', TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched', + TRANSACTION_VIEWED = 'Transaction - Viewed', QUOTE_FETCHED = 'Quote - Fetched', QUOTE_ERROR = 'Quote - Error', } @@ -149,6 +152,7 @@ export const analytics = { return eventOptions; }, trackInstantOpened: trackingEventFnWithoutPayload(EventNames.INSTANT_OPENED), + trackInstantClosed: trackingEventFnWithoutPayload(EventNames.INSTANT_CLOSED), trackAccountLocked: trackingEventFnWithoutPayload(EventNames.ACCOUNT_LOCKED), trackAccountReady: (address: string) => trackingEventFnWithPayload(EventNames.ACCOUNT_READY)({ address }), trackAccountUnlockRequested: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_REQUESTED), @@ -201,6 +205,8 @@ export const analytics = { trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload), trackTokenSelectorSearched: (searchText: string) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }), + trackTransactionViewed: (orderProcesState: OrderProcessState) => + trackingEventFnWithPayload(EventNames.TRANSACTION_VIEWED)({ orderState: orderProcesState }), trackQuoteFetched: (buyQuote: BuyQuote, fetchOrigin: QuoteFetchOrigin) => trackingEventFnWithPayload(EventNames.QUOTE_FETCHED)({ ...buyQuoteEventProperties(buyQuote), |