electerious / Ackee

Self-hosted, Node.js based analytics tool for those who care about privacy.
https://ackee.electerious.com
MIT License
4.27k stars 359 forks source link

Migrating and updating Ackee screwed up unique visitor count #305

Closed CookedApps closed 2 years ago

CookedApps commented 2 years ago

🐞 Describe the bug

Unique visitor count exploded after migrating to another server and switching from Ackee version 3.1.0 to 3.3.0. I moved my Ackee instance to another server and bumped up the version of Ackee and MongoDB. I restored the database using mongorestore, which worked like a charm. Everything worked just fine on the new server. I also changed the subdomain under which Ackee runs. We use use-ackee 3.0.0 in the frontend and I adjusted the URL there.

See screenshot below: You can clearly see the bump in unique visitors. I am 100% sure this is incorrect. This completely fucked up our statistics. Is there any way to recover the truth?

📚 To Reproduce

💡 Expected behavior

🖼️ Screenshots

Bildschirmfoto 2021-12-26 um 10 59 03

⚙️ Environment

CookedApps commented 2 years ago

This might be related to #304

electerious commented 2 years ago

Does this only affect existing statistics in the history or also new visits?

CookedApps commented 2 years ago

@electerious It only affects new visits. The statistics prior to the peak you see in my screenshot are correct, and the peak is incorrect (seemingly non-unique visitors).

I switched back to version 3.1.1 which fixed new visits, but the peak still remains. Haven't tested it with version 3.2.0 but 3.3.0 is definitely broken.

I need a fix which corrects this peak. Otherwise, my total statistics will be useless forever.

electerious commented 2 years ago

There shouldn't be any changes related to the unique visitor count in 3.2.0 and 3.3.0. I'm not sure why this happened. Restarting the server will create a new salt and all upcoming visitors will be tracked as unique. But this should only affect the current day (the day of the restart). Your peak is way too high to say that it's just because of the new salt.

I'm closing this issue, because there's currently nothing I can do. Fixing #304 could help and make this less likely to happen.

I need a fix which corrects this peak. Otherwise, my total statistics will be useless forever.

The only way to do so is to delete all records in the database of that day.