aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/utils/analytics.ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-08-30 05:33:55 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-08-31 04:24:24 +0800
commit82a01ef0200571d7e9079647d6b70d2d25e6ce05 (patch)
tree99401fa4bd6f5cf23b9a4be8d09fdab79bf10b06 /packages/website/ts/utils/analytics.ts
parent81ba2a8411abc84ab052a65e1c674af44b8cf746 (diff)
downloaddexon-0x-contracts-82a01ef0200571d7e9079647d6b70d2d25e6ce05.tar.gz
dexon-0x-contracts-82a01ef0200571d7e9079647d6b70d2d25e6ce05.tar.zst
dexon-0x-contracts-82a01ef0200571d7e9079647d6b70d2d25e6ce05.zip
Initial changes for v2 portal
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);
}