-
-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ackee counting unique page views on every page refresh #304
Comments
Which version of Ackee do you use? |
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. 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 |
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
The text was updated successfully, but these errors were encountered: