diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-28 07:10:40 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-28 07:13:32 +0800 |
commit | c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30 (patch) | |
tree | 55fbd82f4bb9c5f8e689684238d539bcd4e2fee1 /packages/instant/src/util/analytics.ts | |
parent | 47a87e57f1cfa82375c87829320f30049217d657 (diff) | |
download | dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.tar dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.tar.gz dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.tar.bz2 dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.tar.lz dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.tar.xz dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.tar.zst dexon-sol-tools-c5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30.zip |
feat(instant): Quote fetch tracking
Diffstat (limited to 'packages/instant/src/util/analytics.ts')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index 5bc9bb385..204b6921d 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -1,7 +1,7 @@ import { BuyQuote } from '@0x/asset-buyer'; import * as _ from 'lodash'; -import { AffiliateInfo, Asset, Network, OrderSource, ProviderState } from '../types'; +import { AffiliateInfo, Asset, Network, OrderSource, ProviderState, QuoteFetchedVia } from '../types'; import { EventProperties, heapUtil } from './heap'; @@ -37,6 +37,8 @@ enum EventNames { TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed', TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose', TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched', + QUOTE_FETCHED = 'Quote - Fetched', + QUOTE_ERROR = 'Quote - Error', } const track = (eventName: EventNames, eventProperties: EventProperties = {}): void => { @@ -177,4 +179,9 @@ export const analytics = { trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload), trackTokenSelectorSearched: (searchText: string) => trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }), + trackQuoteFetched: (buyQuote: BuyQuote, fetchedVia: QuoteFetchedVia) => + trackingEventFnWithPayload(EventNames.QUOTE_FETCHED)({ + ...buyQuoteEventProperties(buyQuote), + fetchedVia, + }), }; |