The following variables and functions let you store measurement calls when the application is offline.
To enable offline tracking, your report suite must be timestamp-enabled. If timestamps are enabled on your report suite, your trackOffline configuration property must be true. if your report suite is not timestamp enabled, your trackOffline configuration property must be false. If this is not configured correctly, data will be lost. If you are not sure if a report suite is timestamp enabled, contact Customer Care
When enabled, Offline AppMeasurement behaves in the following way:
- The application sends a server call, but the data transmission fails.
- AppMeasurement generates a timestamp for the current hit.
- AppMeasurement buffers the hit data, and backs up buffered hit data to persistent storage to prevent data loss.
At each subsequent hit, or at the interval defined by offlineThrottleDelay , AppMeasurement attempts to send the buffered hit data, maintaining the original hit order. If the data transmission fails, it continues to buffer the hit data (This continues while the device is offline).
|Property or Method||Description|
Enables or disables offline tracking for the measurement library.
Default: no limit
Maximum number of offline hits stored in the queue.
Specifies a cadence (or delay), in milliseconds, for sending buffered hit data when AppMeasurement detects an active network connection. Doing so mitigates the performance impact of sending multiple hits on the application.
For example, if offlineThrottleDelay=1000, and it takes 300ms to send the hit data, AppMeasurement waits 700ms before sending the next buffered hit.s.offlineThrottleDelay=1000;
Manually set the online or offline state of the measurement object. The library automatically detects when the device is offline or online, so these methods are needed only if you want to force measurement offline. forceOnline is used only to return to the online state after manually going offline.
When measurement is offline: