Open creotip opened 2 years ago
Which version of Ackee do you use? I have a similar problem, maybe it has something to do with it. See #305
This could have to do something with Vercel / serverless functions and the way Ackee generates the salt. A new one will be generated on every function invocation and the salt won't stay the same for the whole day like it does when used in a "normal" setup. I never thought about this and it's funny that no one complained about it so far.
I guess we need to find a way to generate a salt that is unique per day, but still different from user to user.
The current implementation: https://github.com/electerious/Ackee/blob/master/src/utils/salt.js
Ideas and PRs welcome.
We have a similar Issue with our site.
We invoke the instance.record
method of the tracker every time a user navigates on our page.
In the Ackee dashboard, every single navigation from every user counts as a view.
This doesn't seem like expected behavior.
Where can we see our unique visitors?
same for me. This is the first time i use ackee, and i'm experiencing that if i reload the page it do a +1 on unique views
Can confirm the issue. It doesn't seem to be a Vercel / serverless function only issue. Will take a closer look at it on the weekend. Help is welcome!
Looks like we missed an important detail in the mongoose upgrade guide when we updated mongoose (#291). The unique visitor count and anonymisation is broken* since 3.2.0. I've pushed a fixed to the develop branch and will do some testing so I can release a hotfix tomorrow.
The unique visitor count might still be broken in serverless environments and we need a better way to generate a daily, but unique salt: https://github.com/electerious/Ackee/blob/master/src/utils/salt.js
The unique visitor count might still be broken in serverless environments and we need a better way to generate a daily, but unique salt: https://github.com/electerious/Ackee/blob/master/src/utils/salt.js
We could just hash the current date concated with something instance specific (the ACKEE_USERNAME?) and some value hardcoded.
@mathe42 That could work. It just feels a bit weird to use ACKEE_USERNAME for that, but the salt is never exposed, so it shouldn't be a security issue. Maybe it's also an option to add something like ACKEE_SALT.
Fixed in v3.3.1 (for non serverless environments).
Ackee counting unique page on every page refresh. Using next.js with next following code in _app.tsx:
⚙️ Environment