DavidWells / DavidWells/analytics
sendBeacon support
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Some tools such as GA support a transport=beacon option that tells it to use navigator.sendBeacon to send the request. See an example for GA's analytics.js here.
Do you have any plans to support this as a param to pass through, or perhaps automatically use the beacon-based approach when its supported? It's important for firing any events before unload or a redirect without needing workarounds such as a delay via setTimeout. Apologies if I just missed any documentation around this.
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the issue's Google Analytics sendBeacon example and the analytics package's existing transport documentation and event-sending entry points. Done would mean a decided and documented way to support navigator.sendBeacon, either through a transport parameter or an automatic approach for events sent before unload or redirect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- analytics, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100