diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-27 07:51:40 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-11-27 07:51:40 +0800 |
commit | 7610130f7353ea6134fae441a8fe23e0fd0ddb2f (patch) | |
tree | 5e8ff7cc28740790834a804705249c22764a2696 /packages/instant/src/redux | |
parent | d5898a3a050a8c97e516dba62ba040140fd74c62 (diff) | |
download | dexon-sol-tools-7610130f7353ea6134fae441a8fe23e0fd0ddb2f.tar.gz dexon-sol-tools-7610130f7353ea6134fae441a8fe23e0fd0ddb2f.tar.zst dexon-sol-tools-7610130f7353ea6134fae441a8fe23e0fd0ddb2f.zip |
Track numberAvailableAssets, selectedAssetName, selectedAssetData event properties
Diffstat (limited to 'packages/instant/src/redux')
-rw-r--r-- | packages/instant/src/redux/analytics_middleware.ts | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/packages/instant/src/redux/analytics_middleware.ts b/packages/instant/src/redux/analytics_middleware.ts index 1a8aefb38..8aa76eb77 100644 --- a/packages/instant/src/redux/analytics_middleware.ts +++ b/packages/instant/src/redux/analytics_middleware.ts @@ -55,10 +55,25 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction } break; case ActionTypes.UPDATE_SELECTED_ASSET: - if (curState.selectedAsset) { + const selectedAsset = curState.selectedAsset; + if (selectedAsset) { + const assetName = selectedAsset.metaData.name; + const assetData = selectedAsset.assetData; analytics.trackTokenSelectorChose({ - assetName: curState.selectedAsset.metaData.name, - assetData: curState.selectedAsset.assetData, + assetName, + assetData, + }); + analytics.addEventProperties({ + selectedAssetName: assetName, + selectedAssetData: assetData, + }); + } + break; + case ActionTypes.SET_AVAILABLE_ASSETS: + const availableAssets = curState.availableAssets; + if (availableAssets) { + analytics.addEventProperties({ + numberAvailableAssets: availableAssets.length, }); } break; |