aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorThomas Schmidt <tomhschmidt@thomass-mbp-2.lan>2018-02-06 08:20:53 +0800
committerThomas Schmidt <tomhschmidt@thomass-mbp-2.lan>2018-02-06 08:20:53 +0800
commit75ded897907461e63990fd3bb2d503213768edd8 (patch)
treea7bc6ec8622cb2a2770389cc87ddd9d23f540128 /packages/website/ts
parent598ce0d40129b7426d47404a3e6ff886c2e186b9 (diff)
downloaddexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.tar
dexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.tar.gz
dexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.tar.bz2
dexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.tar.lz
dexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.tar.xz
dexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.tar.zst
dexon-sol-tools-75ded897907461e63990fd3bb2d503213768edd8.zip
GA logging for order creation
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/components/generate_order/generate_order_form.tsx12
-rw-r--r--packages/website/ts/components/inputs/allowance_toggle.tsx13
2 files changed, 21 insertions, 4 deletions
diff --git a/packages/website/ts/components/generate_order/generate_order_form.tsx b/packages/website/ts/components/generate_order/generate_order_form.tsx
index df1241d8d..c07e6173a 100644
--- a/packages/website/ts/components/generate_order/generate_order_form.tsx
+++ b/packages/website/ts/components/generate_order/generate_order_form.tsx
@@ -4,6 +4,7 @@ import * as _ from 'lodash';
import Dialog from 'material-ui/Dialog';
import Divider from 'material-ui/Divider';
import * as React from 'react';
+import * as ReactGA from 'react-ga';
import { Blockchain } from 'ts/blockchain';
import { ExpirationInput } from 'ts/components/inputs/expiration_input';
import { HashInput } from 'ts/components/inputs/hash_input';
@@ -261,6 +262,12 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
) {
const didSignSuccessfully = await this._signTransactionAsync();
if (didSignSuccessfully) {
+ ReactGA.event({
+ category: 'Portal',
+ action: 'Sign Order Success',
+ label: this.props.tokenByAddress[debitToken.address].symbol,
+ value: debitToken.amount,
+ });
this.setState({
globalErrMsg: '',
shouldShowIncompleteErrs: false,
@@ -273,6 +280,11 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
globalErrMsg = 'You must enable wallet communication';
this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
}
+ ReactGA.event({
+ category: 'Portal',
+ action: 'Sign Order Failure',
+ label: globalErrMsg,
+ });
this.setState({
globalErrMsg,
shouldShowIncompleteErrs: true,
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx
index 26c693dee..dc6fdc198 100644
--- a/packages/website/ts/components/inputs/allowance_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_toggle.tsx
@@ -76,15 +76,20 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
}
try {
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits)
- .then((fulfilled: any) => {
+ .then(() => {
ReactGA.event({
category: 'Portal',
- action: 'Set Allowance',
+ action: 'Set Allowance Success',
+ label: this.props.token.symbol,
+ value: newAllowanceAmountInBaseUnits,
+ });
+ }, () => {
+ ReactGA.event({
+ category: 'Portal',
+ action: 'Set Allowance Failure',
label: this.props.token.symbol,
value: newAllowanceAmountInBaseUnits,
});
- }, (rejected: any) => {
- console.log(rejected);
});
await this.props.refetchTokenStateAsync();
} catch (err) {