diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-10 23:53:42 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-10 23:53:42 +0800 |
commit | cea8dcae3dac2265d3780c95d6581fe48e9b94a4 (patch) | |
tree | 527d82d0123ec38924c4459b833131f379e20f71 /packages/website/ts/components/generate_order | |
parent | fc7e7d9331692510b2cf5baebcff948ebf0afc07 (diff) | |
download | dexon-0x-contracts-cea8dcae3dac2265d3780c95d6581fe48e9b94a4.tar.gz dexon-0x-contracts-cea8dcae3dac2265d3780c95d6581fe48e9b94a4.tar.zst dexon-0x-contracts-cea8dcae3dac2265d3780c95d6581fe48e9b94a4.zip |
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
Diffstat (limited to 'packages/website/ts/components/generate_order')
-rw-r--r-- | packages/website/ts/components/generate_order/generate_order_form.tsx | 15 |
1 files changed, 3 insertions, 12 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 26fa904fe..5e356528e 100644 --- a/packages/website/ts/components/generate_order/generate_order_form.tsx +++ b/packages/website/ts/components/generate_order/generate_order_form.tsx @@ -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, |