@mattab opened this Issue on November 7th 2018 Member

assuming that the trial went well, then in Matomo 4.0.0 we would like to enable the feature alwaysUseSendBeacon by default.

see https://github.com/matomo-org/matomo/pull/13451 https://github.com/matomo-org/matomo/issues/6641

@Findus23 commented on November 8th 2018 Member

Keep in mind that a large portion of users have sendbeacon disabled for privacy reasons. Disabling in Firefox via the about:config key beacon.enabled removes navigator.sendBeacon so the fallback should work.
The popular open source adblocker uBlock origin also has a (enabled by default) setting to remove sendbeacon and <a ping>, but in my test the request still worked.

So we should do a lot of testing to avoid the fallback not working (e.g. if navigator.sendBeacon still exists, but is blocked).

@tsteur commented on November 8th 2018 Member

One thing to keep in mind is that the callback parameter won't work anymore (because there is no event or what so ever when the request is finished). Some users rely on this see eg https://github.com/matomo-org/matomo/issues/13679#issuecomment-436748761

@tsteur commented on November 8th 2018 Member

Actually, callbacks won't be a problem cause we call the callback if the browser confirms it sent the request.

@mattab commented on March 14th 2019 Member
  • Another concern is that if all send beacon requests are sent as POST then these request could not be replayed (FAQ), which could result in rare cases (maintenance, downtime) in lost data when recovering logs. (will need to document this more clearly in this FAQ which actions wouldn't be likely replayed because of send beacon)
@tsteur commented on March 14th 2019 Member

They are sent as request parameters unless the request is large AFAIK

@mattab commented on October 20th 2019 Member

Also we just found out that when closing the tab/window, Chrome seems to not execute sendBeacon on beforeunload unfortunately!? so we wouldn't want to rely on this feature probably...

@tsteur commented on October 20th 2019 Member

@mattab it's still good for sending requests when the browser closes. It will be more reliable than the XHR. It just means we can't collect all requests, optimize them, and send them at the end of the page view. Like instead of pinging Matomo every 15s using heartbeat it would have better to send only one request when the browser closes... but this won't work reliably

@sgiehl commented on January 25th 2020 Member

fixed with #15405, will be included in Matomo 4

This Issue was closed on January 25th 2020
Powered by GitHub Issue Mirror