System Design · Middle · Question 43 of 75
How do you send analytics events efficiently?
- ✓Correct answer: Queue them, send in batches and flush when the page is hidden
- 2Send a separate request for every click immediately
- 3Store all events in cookies and send them once a week
Explanation
Batching reduces the number of requests and the load on the main thread. On visibilitychange to hidden, the remainder is sent via sendBeacon. User consent (cookie consent) must be respected.