maxAgeOfQueuedEvents

The maxAgeOfQueuedEvents property sets a time limit for storing events in local storage. Events older than this value are dropped before the next dispatch. The default value is 0, which means events are kept for an unlimited time.

Syntax

PiwikTracker.sharedInstance()?.maxAgeOfQueuedEvents = seconds
[PiwikTracker sharedInstance].maxAgeOfQueuedEvents = seconds;

Parameters

  • maxAgeOfQueuedEvents number, required - The time (in seconds) after which queued events are removed from local storage. Default value: 0, which means events are kept for an unlimited time. Set a positive value to enable expiry.

Examples

To set the time limit to 12 hours (12x60x60 seconds):

PiwikTracker.sharedInstance()?.maxAgeOfQueuedEvents = 12 * 60 * 60
[PiwikTracker sharedInstance].maxAgeOfQueuedEvents = 12 * 60 * 60;

Related methods