aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/redux/analytics_middleware.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/instant/src/redux/analytics_middleware.ts')
-rw-r--r--packages/instant/src/redux/analytics_middleware.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/instant/src/redux/analytics_middleware.ts b/packages/instant/src/redux/analytics_middleware.ts
index 299c2560e..8aa76eb77 100644
--- a/packages/instant/src/redux/analytics_middleware.ts
+++ b/packages/instant/src/redux/analytics_middleware.ts
@@ -53,6 +53,30 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
).toString();
analytics.addUserProperties({ ethBalanceInUnitAmount });
}
+ break;
+ case ActionTypes.UPDATE_SELECTED_ASSET:
+ const selectedAsset = curState.selectedAsset;
+ if (selectedAsset) {
+ const assetName = selectedAsset.metaData.name;
+ const assetData = selectedAsset.assetData;
+ analytics.trackTokenSelectorChose({
+ 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;
}
return nextAction;