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
tracker.setVisitorIDLifetime(milliseconds)getTracker().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):
tracker.setVisitorIDLifetime(30L * 24 * 60 * 60 * 1000)getTracker().setVisitorIDLifetime(30L * 24 * 60 * 60 * 1000);Related methods
Updated 15 days ago