aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/analytics.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 07:10:40 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 07:13:32 +0800
commitc5d6b925e4e04d5b6cfd0623d0a1449ba69d3a30 (patch)
tree55fbd82f4bb9c5f8e689684238d539bcd4e2fee1 /packages/instant/src/util/analytics.ts
parent47a87e57f1cfa82375c87829320f30049217d657 (diff)
downloaddexon-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.ts9
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,
+ }),
};