mirror of https://github.com/vector-im/riot-web
strip most of the actual file path in the redacted url (#1022)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
a9d516e8ea
commit
3411fabf12
|
@ -19,8 +19,10 @@ import MatrixClientPeg from './MatrixClientPeg';
|
||||||
import PlatformPeg from './PlatformPeg';
|
import PlatformPeg from './PlatformPeg';
|
||||||
import SdkConfig from './SdkConfig';
|
import SdkConfig from './SdkConfig';
|
||||||
|
|
||||||
function redact(str) {
|
function getRedactedUrl() {
|
||||||
return str.replace(/#\/(room|user)\/(.+)/, "#/$1/<redacted>");
|
const base = window.location.pathname.split('/').slice(-2).join('/');
|
||||||
|
const redactedHash = window.location.hash.replace(/#\/(room|user)\/(.+)/, "#/$1/<redacted>");
|
||||||
|
return base + redactedHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
const customVariables = {
|
const customVariables = {
|
||||||
|
@ -108,7 +110,7 @@ class Analytics {
|
||||||
this.firstPage = false;
|
this.firstPage = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._paq.push(['setCustomUrl', redact(window.location.href)]);
|
this._paq.push(['setCustomUrl', getRedactedUrl()]);
|
||||||
this._paq.push(['trackPageView']);
|
this._paq.push(['trackPageView']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue