2019-04-29 08:18:40 +02:00
|
|
|
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) {
|
2019-07-31 22:17:11 +02:00
|
|
|
sendMetaMetricsEvent({
|
|
|
|
...stateEventData,
|
|
|
|
...eventData,
|
|
|
|
url: METAMETRICS_TRACKING_URL + '/backend',
|
|
|
|
})
|
2019-04-29 08:18:40 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = backEndMetaMetricsEvent
|