From 00bfc7f889fcf1527c77c7f88816f463843c4282 Mon Sep 17 00:00:00 2001
From: Thomas Schmidt <tomhschmidt@thomass-mbp-2.lan>
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 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(limited to 'packages/website/ts/components/fill_order.tsx')

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<FillOrderProps, FillOrderState> {
                 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<FillOrderProps, FillOrderState> {
             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<FillOrderProps, FillOrderState> {
                 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<FillOrderProps, FillOrderState> {
             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({
-- 
cgit v1.2.3

