aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/inputs
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-12 18:28:34 +0800
committerGitHub <noreply@github.com>2018-03-12 18:28:34 +0800
commit76a31b6fd69038779166a2532d6d6ee677a91406 (patch)
tree85d37695519c18c9e66e53667c69eb5dd9c8c92b /packages/website/ts/components/inputs
parent0ad3d06ef969904ce1121b76ca129d25839af781 (diff)
parent8a58ffda86289d8126fa5ff56ea24f7b31f3757f (diff)
downloaddexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar
dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.gz
dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.bz2
dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.lz
dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.xz
dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.tar.zst
dexon-sol-tools-76a31b6fd69038779166a2532d6d6ee677a91406.zip
Merge pull request #447 from 0xProject/refactorAnalytics
Refactor Website Analytics
Diffstat (limited to 'packages/website/ts/components/inputs')
-rw-r--r--packages/website/ts/components/inputs/allowance_toggle.tsx16
1 files changed, 3 insertions, 13 deletions
diff --git a/packages/website/ts/components/inputs/allowance_toggle.tsx b/packages/website/ts/components/inputs/allowance_toggle.tsx
index 3d353d87c..e548bfc82 100644
--- a/packages/website/ts/components/inputs/allowance_toggle.tsx
+++ b/packages/website/ts/components/inputs/allowance_toggle.tsx
@@ -3,10 +3,10 @@ import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import Toggle from 'material-ui/Toggle';
import * as React from 'react';
-import * as ReactGA from 'react-ga';
import { Blockchain } from 'ts/blockchain';
import { Dispatcher } from 'ts/redux/dispatcher';
import { BalanceErrs, Token, TokenState } from 'ts/types';
+import { analytics } from 'ts/utils/analytics';
import { constants } from 'ts/utils/constants';
import { errorReporter } from 'ts/utils/error_reporter';
import { utils } from 'ts/utils/utils';
@@ -82,20 +82,10 @@ export class AllowanceToggle extends React.Component<AllowanceToggleProps, Allow
const eventLabel = `${this.props.token.symbol}-${networkName}`;
try {
await this.props.blockchain.setProxyAllowanceAsync(this.props.token, newAllowanceAmountInBaseUnits);
- ReactGA.event({
- category: 'Portal',
- action: 'Set Allowance Success',
- label: eventLabel,
- value: newAllowanceAmountInBaseUnits.toNumber(),
- });
+ analytics.logEvent('Portal', 'Set Allowance Success', eventLabel, newAllowanceAmountInBaseUnits.toNumber());
await this.props.refetchTokenStateAsync();
} catch (err) {
- ReactGA.event({
- category: 'Portal',
- action: 'Set Allowance Failure',
- label: eventLabel,
- value: newAllowanceAmountInBaseUnits.toNumber(),
- });
+ analytics.logEvent('Portal', 'Set Allowance Failure', eventLabel, newAllowanceAmountInBaseUnits.toNumber());
this.setState({
isSpinnerVisible: false,
});