1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Add version dimension to background metrics (#9167)

The background metrics were missing the `version` custom dimension. It
has now been added to all background metric events.
This commit is contained in:
Mark Stacey 2020-08-10 12:10:30 -03:00
parent 1a5218ce8e
commit 4d499cc39e
3 changed files with 14 additions and 7 deletions

View File

@ -1,7 +1,7 @@
import { getBackgroundMetaMetricState } from '../../../ui/app/selectors'
import { sendMetaMetricsEvent } from '../../../ui/app/helpers/utils/metametrics.util'
export default function backgroundMetaMetricsEvent (metaMaskState, eventData) {
export default function backgroundMetaMetricsEvent (metaMaskState, version, eventData) {
eventData.eventOpts['category'] = 'Background'
@ -10,6 +10,7 @@ export default function backgroundMetaMetricsEvent (metaMaskState, eventData) {
sendMetaMetricsEvent({
...stateEventData,
...eventData,
version,
currentPath: '/background',
})
}

View File

@ -1842,13 +1842,18 @@ export default class MetamaskController extends EventEmitter {
}
const metamaskState = await this.getState()
backgroundMetaMetricsEvent(metamaskState, {
customVariables,
eventOpts: {
action,
name,
const version = this.platform.getVersion()
backgroundMetaMetricsEvent(
metamaskState,
version,
{
customVariables,
eventOpts: {
action,
name,
},
},
})
)
}
//=============================================================================

View File

@ -115,6 +115,7 @@ function composeParamAddition (paramValue, paramName) {
* @property {string} config.accountType The account type being used at the time of the event: 'hardware', 'imported' or 'default'
* @property {number} config.numberOfTokens The number of tokens that the user has added at the time of the event
* @property {number} config.numberOfAccounts The number of accounts the user has added at the time of the event
* @property {string} config.version The current version of the MetaMask extension
* @property {string} config.previousPath The pathname of the URL the user was on prior to the URL they are on at the time of the event
* @property {string} config.currentPath The pathname of the URL the user is on at the time of the event
* @property {string} config.metaMetricsId A random id assigned to a user at the time of opting in to metametrics. A hexadecimal number