From 00bfc7f889fcf1527c77c7f88816f463843c4282 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Tue, 6 Feb 2018 11:47:24 -0800 Subject: Added logging for order filling and order cancelling --- packages/website/ts/components/fill_order.tsx | 25 ++++++++++++++++++++++ .../ts/components/inputs/allowance_toggle.tsx | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'packages/website') diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index d0cfd2cf5..9da3006a0 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -6,6 +6,7 @@ import { Card, CardHeader, CardText } from 'material-ui/Card'; import Divider from 'material-ui/Divider'; import RaisedButton from 'material-ui/RaisedButton'; import * as React from 'react'; +import * as ReactGA from 'react-ga'; import { Link } from 'react-router-dom'; import { Blockchain } from 'ts/blockchain'; import { TrackTokenConfirmationDialog } from 'ts/components/dialogs/track_token_confirmation_dialog'; @@ -565,6 +566,12 @@ export class FillOrder extends React.Component { signedOrder, this.props.orderFillAmount, ); + ReactGA.event({ + category: 'Portal', + action: 'Fill Order Success', + label: parsedOrder.taker.token.symbol, + value: parsedOrder.taker.amount, + }); // After fill completes, let's force fetch the token balances this.props.dispatcher.forceTokenStateRefetch(); this.setState({ @@ -578,6 +585,12 @@ export class FillOrder extends React.Component { this.setState({ isFilling: false, }); + ReactGA.event({ + category: 'Portal', + action: 'Fill Order Failure', + label: parsedOrder.taker.token.symbol, + value: parsedOrder.taker.amount, + }); const errMsg = `${err}`; if (utils.didUserDenyWeb3Request(errMsg)) { return; @@ -653,6 +666,12 @@ export class FillOrder extends React.Component { globalErrMsg: '', unavailableTakerAmount: takerTokenAmount, }); + ReactGA.event({ + category: 'Portal', + action: 'Cancel Order Success', + label: parsedOrder.maker.token.symbol, + value: parsedOrder.maker.amount, + }); return; } catch (err) { this.setState({ @@ -662,6 +681,12 @@ export class FillOrder extends React.Component { if (utils.didUserDenyWeb3Request(errMsg)) { return; } + ReactGA.event({ + category: 'Portal', + action: 'Cancel Order Failure', + label: parsedOrder.maker.token.symbol, + value: parsedOrder.maker.amount, + }); globalErrMsg = 'Failed to cancel order, please refresh and try again'; utils.consoleLog(`${err}`); this.setState({ diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx index 0a42df71b..a737222ca 100644 --- a/packages/website/ts/components/inputs/allowance_toggle.tsx +++ b/packages/website/ts/components/inputs/allowance_toggle.tsx @@ -75,7 +75,7 @@ export class AllowanceToggle extends React.Component