Refactor Analytics so that calls to ReactGA are all in a single module, combining the provider type util function, moving GA id to configs and using utils.onPageLoadAsync
This commit is contained in:
@@ -5,7 +5,6 @@ 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';
|
||||
@@ -23,6 +22,7 @@ import { validator } from 'ts/schemas/validator';
|
||||
import { AlertTypes, BlockchainErrs, HashData, Side, SideToAssetToken, Token, TokenByAddress } from 'ts/types';
|
||||
import { constants } from 'ts/utils/constants';
|
||||
import { errorReporter } from 'ts/utils/error_reporter';
|
||||
import { analytics } from 'ts/utils/analytics';
|
||||
import { utils } from 'ts/utils/utils';
|
||||
|
||||
enum SigningState {
|
||||
@@ -255,12 +255,7 @@ export class GenerateOrderForm extends React.Component<GenerateOrderFormProps, G
|
||||
if (didSignSuccessfully) {
|
||||
const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId];
|
||||
const eventLabel = `${this.props.tokenByAddress[debitToken.address].symbol}-${networkName}`;
|
||||
ReactGA.event({
|
||||
category: 'Portal',
|
||||
action: 'Sign Order Success',
|
||||
label: eventLabel,
|
||||
value: debitToken.amount.toNumber(),
|
||||
});
|
||||
analytics.logEvent('Portal', 'Sign Order Success', eventLabel, debitToken.amount.toNumber());
|
||||
this.setState({
|
||||
globalErrMsg: '',
|
||||
shouldShowIncompleteErrs: false,
|
||||
@@ -273,11 +268,7 @@ 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,
|
||||
});
|
||||
analytics.logEvent('Portal', 'Sign Order Failure', globalErrMsg);
|
||||
this.setState({
|
||||
globalErrMsg,
|
||||
shouldShowIncompleteErrs: true,
|
||||
|
||||
Reference in New Issue
Block a user