diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-17 01:16:20 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-17 01:16:20 +0800 |
commit | df71dba8edcba5ca5731bed969748bdcc73efe92 (patch) | |
tree | 0ad0dcc2eccdcb1e13162e5c33268b1a5241d1b1 /packages/instant/src/util/analytics.ts | |
parent | 37d60dc39ea6476c3185e124175cb02d5e830250 (diff) | |
download | dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.tar dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.tar.gz dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.tar.bz2 dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.tar.lz dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.tar.xz dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.tar.zst dexon-sol-tools-df71dba8edcba5ca5731bed969748bdcc73efe92.zip |
Make user and event properties more specific
Diffstat (limited to 'packages/instant/src/util/analytics.ts')
-rw-r--r-- | packages/instant/src/util/analytics.ts | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts index 30193839e..92f717f7b 100644 --- a/packages/instant/src/util/analytics.ts +++ b/packages/instant/src/util/analytics.ts @@ -23,12 +23,21 @@ function trackingEventFnWithPayload<T extends ObjectMap<string | number>>( }; } +export interface AnalyticsUserOptions { + ethAddress?: string; + ethBalanceInUnitAmount?: string; +} +export interface AnalyticsEventOptions { + embeddedHost?: string; + embeddedUrl?: string; + networkId: number; + providerName: string; +} export const analytics = { - // TODO(sk): make these more specific - addUserProperties: (properties: ObjectMap<string | number>): void => { + addUserProperties: (properties: AnalyticsUserOptions): void => { heapUtil.evaluateHeapCall(heap => heap.addUserProperties(properties)); }, - addEventProperties: (properties: ObjectMap<string | number>): void => { + addEventProperties: (properties: AnalyticsEventOptions): void => { heapUtil.evaluateHeapCall(heap => heap.addEventProperties(properties)); }, walletOpened: trackingEventFnWithoutPayload(EventNames.WALLET_OPENED), |