sessionTimeout

The sessionTimeout property sets how long a session can remain inactive before the SDK starts a new session. The value is specified in seconds. The default is 1800 (30 minutes).

Syntax

Set sessionTimeout on the shared tracker:

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

Parameters

  • sessionTimeout (number, seconds)
    The inactivity period before the SDK starts a new session. When this amount of time passes without tracked activity, the next event starts a new session. Default: 1800 (30 minutes).

Examples

To set the expiration time to 60 minutes (60*60 seconds):

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

Notes

  • The Piwik PRO backend can also start a new visit when events are more than 30 minutes apart. If you change this value, make sure the client and server use compatible session settings.

Related methods


Did this page help you?