setVisitorIDLifetime

The setVisitorIDLifetime() method sets the visitor ID lifetime. After it expires, a new visitor ID is generated. The default value is 0, which means the visitor ID never expires.

Syntax

getTracker().setVisitorIDLifetime(milliseconds);
tracker.setVisitorIDLifetime(milliseconds)

Parameters

milliseconds (number, required)

The lifetime duration (in milliseconds) for the visitor ID. Default value: 0 (the visitor ID never expires).

Examples

To set the visitor ID lifetime to 30 days (30x24x60x60x1000 milliseconds):

getTracker().setVisitorIDLifetime(30L * 24 * 60 * 60 * 1000);
tracker.setVisitorIDLifetime(30L * 24 * 60 * 60 * 1000)

Related methods