diff --git a/ui/components/app/signature-request-original/signature-request-original.component.js b/ui/components/app/signature-request-original/signature-request-original.component.js index 41312296c..ec3baf497 100644 --- a/ui/components/app/signature-request-original/signature-request-original.component.js +++ b/ui/components/app/signature-request-original/signature-request-original.component.js @@ -285,7 +285,9 @@ export default class SignatureRequestOriginal extends Component { history, mostRecentOverviewPage, sign, + txData: { type }, } = this.props; + const { metricsEvent, t } = this.context; return (
@@ -296,18 +298,21 @@ export default class SignatureRequestOriginal extends Component { onClick={async (event) => { this._removeBeforeUnload(); await cancel(event); - this.context.metricsEvent({ + metricsEvent({ eventOpts: { category: 'Transactions', action: 'Sign Request', name: 'Cancel', }, + customVariables: { + type, + }, }); clearConfirmTransaction(); history.push(mostRecentOverviewPage); }} > - {this.context.t('cancel')} + {t('cancel')}
); diff --git a/ui/components/app/signature-request/signature-request.component.js b/ui/components/app/signature-request/signature-request.component.js index 37eefcfeb..3f460b4c2 100644 --- a/ui/components/app/signature-request/signature-request.component.js +++ b/ui/components/app/signature-request/signature-request.component.js @@ -33,7 +33,11 @@ export default class SignatureRequest extends PureComponent { } _beforeUnload = (event) => { - const { clearConfirmTransaction, cancel } = this.props; + const { + clearConfirmTransaction, + cancel, + txData: { type }, + } = this.props; const { metricsEvent } = this.context; metricsEvent({ eventOpts: { @@ -41,6 +45,9 @@ export default class SignatureRequest extends PureComponent { action: 'Sign Request', name: 'Cancel Sig Request Via Notification Close', }, + customVariables: { + type, + }, }); clearConfirmTransaction(); cancel(event); @@ -57,22 +64,46 @@ export default class SignatureRequest extends PureComponent { const { fromAccount, txData: { - msgParams: { data, origin }, + msgParams: { data, origin, version }, + type, }, cancel, sign, } = this.props; const { address: fromAddress } = fromAccount; const { message, domain = {} } = JSON.parse(data); + const { metricsEvent } = this.context; const onSign = (event) => { window.removeEventListener('beforeunload', this._beforeUnload); sign(event); + metricsEvent({ + eventOpts: { + category: 'Transactions', + action: 'Sign Request', + name: 'Confirm', + }, + customVariables: { + type, + version, + }, + }); }; const onCancel = (event) => { window.removeEventListener('beforeunload', this._beforeUnload); cancel(event); + metricsEvent({ + eventOpts: { + category: 'Transactions', + action: 'Sign Request', + name: 'Cancel', + }, + customVariables: { + type, + version, + }, + }); }; return (