microsoft / clarity

A behavioral analytics library that uses dom mutations and user interactions to generate aggregated insights.
https://clarity.microsoft.com
MIT License
2.16k stars 215 forks source link

Enhance Error Reporting with Beacon API and Fallback to XHR #692

Open Rajaniraiyn opened 3 weeks ago

Rajaniraiyn commented 3 weeks ago

This PR improves the error reporting mechanism in Microsoft’s Clarity data collection and analytics package by introducing support for the navigator.sendBeacon API with a fallback to XMLHttpRequest for enhanced reliability and performance.

Utilizing the navigator.sendBeacon API for asynchronous, non-blocking error reporting to the server, ensuring data is sent effectively even when users navigate away from the page.

Rajaniraiyn commented 3 weeks ago

@microsoft-github-policy-service agree