Opened 23 months ago
Last modified 4 months ago
#58050 new defect (bug)
A beacon api for WordPress
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
Forgive me is there is already a ticket for this, I could not find one
Core needs a standard way of sending a beacon as the user leaves a page, with the ability to to hook additional data to the request. Similar to how you can hook data to the heartbeat.
Of course it is possible to build your own solution on this BUT what if some other developer does the same. In the absence of a standard there will be multiple redundant http requests.
Change History (2)
#2
@
4 months ago
I am supporting the creation of a WordPress specific way of adding data to a beacon api call when a user leaves a page because it could save a http requests
My use case is I want to log user activity to my own server. Of course I can roll my own solution using the beacon api BUT what happens when another plugin want to log other information when the page unloads? They will create beacon request leading to multiple http requests when all the data could easily be rolled into one request.
We have an equivalent api for Ajax polling, the heartbeat api. This works well for polling as plugins can simply piggy back their data on the heartbeat
A similar api for page unload beacons would serve a similar purpose and create a standard way of doing this
Hi @shawfactor,
Thanks for the ticket! Just so I'm clear, are you suggesting support for the Beacon API in the browser? If so, could you talk more about your specific use case?
This could be a risky thing to add because it would potentially double the amount of traffic to every WordPress site. It would need to be very carefully considered.