-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add functionality to use navigator.sendBeacon #45
Conversation
Hi! We have considered it but have decided against using sendBeacon at this time. Sorry :/ |
Alright, thanks. |
@ukutaht Are there any reasons for this? Just curious :) |
The main reason is that we don't currently have team capacity to evaluate this change properly. We'd need to evaluate this approach before choosing to adopt it. Adding
In order to accept long-term maintenance of this complexity, strong arguments must be made. The main pieces of data I'm looking for are:
These two numbers should give us good enough understanding to make a decision. |
As someone who also desires this feature it's a little disappointing to see this closed and I'm sure other people are too.
Whilst I understand these points being a concern, the PR itself is about 5 extra lines of code, of which the majority is just adding the new
Using
The reliability would actually be increased. I don't have percents for you, but considering sendBeacon's purpose it would pretty much guarantee an event would be sent even after they navigate away from the page. It wouldn't be any less reliable than the current method. Regarding adblocking, I've experienced Plausible being adblocked on a few that I've tried so it's not much of a concern here if they no-op sendBeacon. |
FWIW, I'm evaluating Plausible for my company and using sendBeacon is one of our requirements. I'm just going to rewrite the JS myself to make it work. The flipside of Plausible's JS being 3KB is you can rewrite it yourself in an afternoon. |
If you do end up rewriting it and decide it's good enough to share, mind doing so? We were going to use a rewritten version but decided that would be too much work! (I still have our untested version on disk... heh. It's for some time in the future, I suppose.) |
Description
Use a better method of analytics posting.
Related Issue
Fixes #16.
Types of changes
Checklist:
I think a followup to this would be using
navigator.sendBeacon
unlesscallback
is passed. I would be OK with adding that into this.