You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
717 B
22 lines
717 B
import { getMetaMetricState } from '../../../ui/app/selectors/selectors'
|
|
import { sendMetaMetricsEvent } from '../../../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',
|
|
})
|
|
}
|
|
}
|
|
|
|
export default backEndMetaMetricsEvent
|
|
|