Send metrics event from backend for on chain transaction failures (#6500)
* Send metrics event from backend for on chain transaction failures * Passes state object to backEndMetaMetricsEvent, and adds getMetaMetricState selectorfeature/default_network_editable
parent
0095889408
commit
4fea9d0cc2
@ -0,0 +1,26 @@ |
||||
const { |
||||
getMetaMetricState, |
||||
} = require('../../../ui/app/selectors/selectors') |
||||
const { |
||||
sendMetaMetricsEvent, |
||||
} = require('../../../ui/app/helpers/utils/metametrics.util') |
||||
|
||||
const inDevelopment = process.env.NODE_ENV === 'development' |
||||
|
||||
const METAMETRICS_TRACKING_URL = inDevelopment |
||||
? 'http://www.metamask.io/metametrics' |
||||
: 'http://www.metamask.io/metametrics-prod' |
||||
|
||||
function backEndMetaMetricsEvent (metaMaskState, eventData) { |
||||
const stateEventData = getMetaMetricState({ metamask: metaMaskState }) |
||||
|
||||
if (stateEventData.participateInMetaMetrics) { |
||||
sendMetaMetricsEvent({ |
||||
...stateEventData, |
||||
...eventData, |
||||
url: METAMETRICS_TRACKING_URL + '/backend', |
||||
}) |
||||
} |
||||
} |
||||
|
||||
module.exports = backEndMetaMetricsEvent |
Loading…
Reference in new issue