mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 21:00:13 +01:00
4d88e1cf86
* Enable indent linting via ESLint * yarn run lint:fix
27 lines
735 B
JavaScript
27 lines
735 B
JavaScript
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
|