fix(insights): privacy fix

This commit is contained in:
Haoyu Xu
2023-07-30 04:34:25 -04:00
parent fecf67a522
commit a33da04729
6 changed files with 27 additions and 11 deletions

View File

@@ -89,7 +89,10 @@ export default class Settings {
this.#doNotTrack = doNotTrack
if (this.#doNotTrack) return
try {
window.umami?.track(props => ({ ...props, url: `/${import.meta.env.VITE_LINK}${isWallpaperEngine ? "?steam" : ""}` }));
window.umami?.track(props => ({
...props,
url: `/${import.meta.env.VITE_LINK}${isWallpaperEngine ? "?steam" : ""}`
}));
} catch(e) {
console.warn && console.warn(e.message)
}
@@ -97,9 +100,12 @@ export default class Settings {
functionInsights(functionName, toSkip = false) {
if (!this.#isInsightsInited || this.#doNotTrack || import.meta.env.MODE === 'development' || functionName === this.#lastFunctionInsights || toSkip) return
this.#lastFunctionInsights = functionName
try {
window.umami?.track(`${functionName}`);
window.umami?.track(props => ({
...props,
name: `${functionName}`,
url: `/${import.meta.env.VITE_LINK}${this.isWallpaperEngine ? "?steam" : ""}`
}));
} catch (e) {
console.warn && console.warn(e.message)
}