1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app/helpers/utils
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
..
common.util.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
common.util.test.js Update ESLint rules for test suite (#8023) 2020-02-11 13:21:13 -03:30
confirm-tx.util.js Reorganize selectors directory (#8497) 2020-05-02 12:41:17 -07:00
confirm-tx.util.test.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
conversion-util.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
conversion-util.test.js remove ramda (#8932) 2020-07-08 15:17:53 -05:00
conversions.util.js Adds decETHToDecWEI util method (#9141) 2020-08-06 09:22:12 -07:00
conversions.util.test.js Adds decETHToDecWEI util method (#9141) 2020-08-06 09:22:12 -07:00
fetch-with-cache.js Prevent accidental use of globals (#8340) 2020-04-15 14:23:27 -03:00
fetch-with-cache.test.js Update fetchWithCacheTests to use assert.rejects (#8334) 2020-04-14 13:03:33 -02:30
formatters.js Folder restructure (#6304) 2019-03-21 20:33:30 -02:30
gas-time-estimates.util.js Add Estimated time to pending tx (#6924) 2019-10-31 23:21:28 -02:30
i18n-helper.js Only log error on first occurrence of missing substitution (#9096) 2020-07-29 13:09:52 -03:00
i18n-helper.test.js Tolerate missing or falsey substitutions (#8907) 2020-07-03 13:02:35 -03:00
metametrics.util.js Remove url parameter from metricsEvent (#9157) 2020-08-07 14:57:27 -03:00
switch-direction.js Enable arrow-parens ESLint rule 2020-02-15 17:04:21 -03:30
token-util.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
transactions.util.js Use string network and chain IDs (#8628) 2020-07-08 14:05:09 -07:00
transactions.util.test.js Use string network and chain IDs (#8628) 2020-07-08 14:05:09 -07:00
util.js Enable guard-for-in rule (#9000) 2020-07-21 18:40:45 -02:30
util.test.js Enable guard-for-in rule (#9000) 2020-07-21 18:40:45 -02:30