From 994a8a31678af49cf9014dcecf0cb77affada909 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Mon, 21 Oct 2019 14:23:26 -0230 Subject: [PATCH] Add metrics events for clicking and saving tx speed ups (#7275) --- .../gas-modal-page-container.component.js | 11 +++++++++++ .../transaction-list-item.component.js | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js index 5e557f660..61e7b9c4d 100644 --- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js +++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js @@ -8,6 +8,7 @@ import BasicTabContent from './basic-tab-content' export default class GasModalPageContainer extends Component { static contextTypes = { t: PropTypes.func, + metricsEvent: PropTypes.func, } static propTypes = { @@ -162,6 +163,7 @@ export default class GasModalPageContainer extends Component { customModalGasPriceInHex, customModalGasLimitInHex, disableSave, + isSpeedUp, ...tabProps } = this.props @@ -175,6 +177,15 @@ export default class GasModalPageContainer extends Component { onCancel={() => cancelAndClose()} onClose={() => cancelAndClose()} onSubmit={() => { + if (isSpeedUp) { + this.context.metricsEvent({ + eventOpts: { + category: 'Navigation', + action: 'Activity Log', + name: 'Saved "Speed Up"', + }, + }) + } onSubmit(customModalGasLimitInHex, customModalGasPriceInHex) }} submitText={this.context.t('save')} diff --git a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js index 47c94acf2..171b8039f 100644 --- a/ui/app/components/app/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/app/transaction-list-item/transaction-list-item.component.js @@ -113,6 +113,14 @@ export default class TransactionListItem extends PureComponent { const retryId = id || initialTransactionId + this.context.metricsEvent({ + eventOpts: { + category: 'Navigation', + action: 'Activity Log', + name: 'Clicked "Speed Up"', + }, + }) + return fetchBasicGasAndTimeEstimates() .then(basicEstimates => fetchGasEstimates(basicEstimates.blockTime)) .then(retryTransaction(retryId, gasPrice))