aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/analytics.ts
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-09-05 03:37:53 +0800
committerGitHub <noreply@github.com>2018-09-05 03:37:53 +0800
commit01210c291c23aae19d201557118f39a8bd970ca0 (patch)
treea93ff78321eda2b98a15669a458622ec79deba1a /packages/website/ts/utils/analytics.ts
parenta5859c6cee0729cf493afa4ff192469cd781fa2b (diff)
parent6eb980abe2900d179f796bfdae4d79544f447952 (diff)
downloaddexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.tar
dexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.tar.gz
dexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.tar.bz2
dexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.tar.lz
dexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.tar.xz
dexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.tar.zst
dexon-sol-tools-01210c291c23aae19d201557118f39a8bd970ca0.zip
Merge pull request #1044 from 0xProject/feature/website/update-portal-v2
[website] Update portal for v2
Diffstat (limited to 'packages/website/ts/utils/analytics.ts')
-rw-r--r--packages/website/ts/utils/analytics.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/website/ts/utils/analytics.ts b/packages/website/ts/utils/analytics.ts
index e5a1ddfa4..62dbff2b9 100644
--- a/packages/website/ts/utils/analytics.ts
+++ b/packages/website/ts/utils/analytics.ts
@@ -1,5 +1,6 @@
+import { assetDataUtils } from '@0xproject/order-utils';
import * as _ from 'lodash';
-import { ObjectMap, Order } from 'ts/types';
+import { ObjectMap, PortalOrder } from 'ts/types';
import { utils } from 'ts/utils/utils';
export interface HeapAnalytics {
@@ -53,12 +54,16 @@ export class Analytics {
}
// tslint:enable:no-floating-promises
// Custom methods
- public trackOrderEvent(eventName: string, order: Order): void {
+ public trackOrderEvent(eventName: string, order: PortalOrder): void {
+ const takerTokenAmount = order.signedOrder.takerAssetAmount.toString();
+ const makerTokenAmount = order.signedOrder.makerAssetAmount.toString();
+ const takerToken = assetDataUtils.decodeERC20AssetData(order.signedOrder.takerAssetData).tokenAddress;
+ const makerToken = assetDataUtils.decodeERC20AssetData(order.signedOrder.makerAssetData).tokenAddress;
const orderLoggingData = {
- takerTokenAmount: order.signedOrder.takerTokenAmount,
- makeTokenAmount: order.signedOrder.makerTokenAmount,
- takerToken: order.metadata.takerToken.symbol,
- makerToken: order.metadata.makerToken.symbol,
+ takerTokenAmount,
+ makerTokenAmount,
+ takerToken,
+ makerToken,
};
this.track(eventName, orderLoggingData);
}