1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00
metamask-extension/app/scripts
Mark Stacey 8713927e5e
Remove url parameter from metricsEvent (#9157)
* Remove `url` parameter from `metricsEvent`

The `url` parameter was used to override the `currentPath`, but it
never worked correctly. It was supposed to be used for setting the
`url` query parameter that was sent to Matomo, but `currentPath` was
always used even if it `url` was set and `currentPath` was empty.

Instead, `currentPath` is now always used. There was never a need to
provide an "override" for `currentPath` when it can be set directly.
The metrics provider does set `currentPath` automatically by default,
but this can be overwritten already by passing a second parameter to
`metricsEvent`.

There were two places this `url` parameter was being used: background
events, and path changes. Background events were submitted with no
`currentPath`, so because of the bug with the `url` parameter, the
metrics utility would crash upon each event. So those were never
actually sent. This commit will fix that crash.

The `currentPath` parameter was supplied as an empty string for the
path change events, so those never crashed. They just had the `url`
query string parameter set incorrectly (to an empty string). It should
now be correctly populated, which should mean we'll be capturing all
path changes now. Previously we were only capturing path changes to
pages that happened to include an event, because of this blank `url`
problem.

* Use `url` query parameter as fallback for generating `pv_id`

The `pv_id` parameter currently isn't generated correctly on Firefox,
as the generation assumes that the current URL starts with
`chrome-extension://`. The `url` query parameter is still unique for
each path, so it's probably good enough for generating an id for each
page.

This is just a temporary fix; it will be removed in a future PR, where
Firefox will be properly supported.
2020-08-07 14:57:27 -03:00
..
account-import-strategies Clean up "JSON File" import strategy test output (#7855) 2020-01-17 19:59:47 -03:30
controllers Use async/await for getRestrictedMethods (#9099) 2020-07-29 19:50:20 -02:30
lib Remove url parameter from metricsEvent (#9157) 2020-08-07 14:57:27 -03:00
migrations Enable guard-for-in rule (#9000) 2020-07-21 18:40:45 -02:30
platforms Fix callback-return issues (#8996) 2020-07-17 20:19:52 -02:30
background.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
chromereload.js Fix console.error references 2016-08-29 17:32:39 -07:00
contentscript.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
first-time-state.js Migrate codebase to use ESM (#7730) 2020-01-09 00:04:58 -03:30
inpage.js Define global web3 as non-enumerable (#8634) 2020-05-20 20:18:25 -07:00
metamask-controller.js Change MetaMetrics category for background events (#9155) 2020-08-07 13:45:49 -03:00
phishing-detect.js blacklist -> blocklist; whitelist -> safelist 2020-06-08 17:49:36 -07:00
ui.js Restore state snapshot for Sentry errors (#9028) 2020-07-17 12:09:38 -03:00