diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-11-21 14:34:57 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-11-21 14:38:49 +0800 |
commit | 351e0e6f5f2add25c4d779356a8cfd4aefb305cb (patch) | |
tree | f9feebf1fce79c1b76f10c2040551ed4a6052154 /packages/instant/src/util/analytics.ts | |
parent | 15f05733be45e05974972c80c4fa8437a62633e2 (diff) | |
download | dexon-0x-contracts-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.gz dexon-0x-contracts-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.tar.zst dexon-0x-contracts-351e0e6f5f2add25c4d779356a8cfd4aefb305cb.zip |
feat(instant): implement account related events
Diffstat (limited to 'packages/instant/src/util/analytics.ts')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index 2ffaac1dd..d36bf8fc3 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -15,7 +15,11 @@ export const evaluateIfEnabled = (fnCall: () => void) => { enum EventNames { INSTANT_OPENED = 'Instant - Opened', - WALLET_READY = 'Wallet - Ready', + ACCOUNT_LOCKED = 'Account - Locked', + ACCOUNT_READY = 'Account - Ready', + ACCOUNT_UNLOCK_REQUESTED = 'Account - Unlock Requested', + ACCOUNT_UNLOCK_DENIED = 'Account - Unlock Denied', + ACCOUNT_ADDRESS_CHANGED = 'Account - Address Changed', } const track = (eventName: EventNames, eventData: ObjectMap<string | number> = {}): void => { evaluateIfEnabled(() => { @@ -59,6 +63,11 @@ export const analytics = { heapUtil.evaluateHeapCall(heap => heap.addEventProperties(properties)); }); }, - trackWalletReady: trackingEventFnWithoutPayload(EventNames.WALLET_READY), trackInstantOpened: trackingEventFnWithoutPayload(EventNames.INSTANT_OPENED), + trackAccountLocked: trackingEventFnWithoutPayload(EventNames.ACCOUNT_LOCKED), + trackAccountReady: (address: string) => trackingEventFnWithPayload(EventNames.ACCOUNT_READY)({ address }), + trackAccountUnlockRequested: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_REQUESTED), + trackAccountUnlockDenied: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_DENIED), + trackAccountAddressChanged: (address: string) => + trackingEventFnWithPayload(EventNames.ACCOUNT_ADDRESS_CHANGED)({ address }), }; |