diff --git a/index.html b/index.html
index ae4d7e2..b05bfbb 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
aklive2d
+ src="https://insights.halyul.dev/insights.js" data-do-not-track="true" data-auto-track="false">
diff --git a/libs/env_generator.js b/libs/env_generator.js
index 5b2f20a..d6ee719 100644
--- a/libs/env_generator.js
+++ b/libs/env_generator.js
@@ -9,6 +9,7 @@ export default class EnvGenerator {
generate() {
return [
+ `VITE_LINK="${this.#operatorConfig.link}"`,
`VITE_TITLE="${this.#operatorConfig.title}"`,
`VITE_FILENAME=${this.#operatorConfig.filename.replace('#', '%23')}`,
`VITE_LOGO_FILENAME=${this.#operatorConfig.logo}`,
diff --git a/src/components/player.js b/src/components/player.js
index 933a9be..b0a757d 100644
--- a/src/components/player.js
+++ b/src/components/player.js
@@ -55,7 +55,7 @@ export default function spinePlayer(el) {
entry.mixDuration = 0.3;
widget.animationState.addAnimation(0, "Idle", true, 0);
}
- window.settings.loadViewport()
+ window.settings.success()
},
})
}
\ No newline at end of file
diff --git a/src/components/settings.js b/src/components/settings.js
index f01499b..796aa68 100644
--- a/src/components/settings.js
+++ b/src/components/settings.js
@@ -37,6 +37,7 @@ export default class Settings {
#padBottom = this.#defaultPadBottom
#logoX = this.#defaultLogoX
#logoY = this.#defaultLogoY
+ #isInsightsInited = false
constructor(el, logoEl) {
this.#el = el
@@ -62,6 +63,17 @@ export default class Settings {
this.#insertHTML()
}
+ success() {
+ this.loadViewport()
+ this.insights(false)
+ }
+
+ insights(flag) {
+ if (this.#isInsightsInited) return
+ window.umami.trackView(`/${import.meta.env.VITE_LINK}${flag ? "?steam" : ""}`);
+ this.#isInsightsInited = true
+ }
+
setFPS(value) {
this.#fps = value
this.spinePlayer.setFps(value)
diff --git a/src/libs/wallpaper_engine.js b/src/libs/wallpaper_engine.js
index 35e8e28..f724508 100644
--- a/src/libs/wallpaper_engine.js
+++ b/src/libs/wallpaper_engine.js
@@ -5,6 +5,7 @@ window.wallpaperPropertyListener = {
}
},
applyUserProperties: function (properties) {
+ window.settings.insights(true)
if (properties.logo) {
window.settings.setLogoDisplay(!properties.logo.value)
}