Posted By: Administrator VRTUZ
Posted Date: 10/31/2020
The obvious solution for tracking offline usage is to create event listeners for the online
and offline
events (which many browsers support) and to put your analytics tracking logic in those listeners. Unfortunately, there are several problems and limitations with this approach:
online
and offline
events can fire for just a split second of network loss, which a user probably wouldn't even see or notice.online
event is not very reliable as it only knows about network access, not internet access. Therefore a user might still be offline, and sending the tracking ping can still fail.You can still use this solution to gain a basic understanding of offline usage, but the many drawbacks and limitations need to be considered carefully.