cookieLifetime
Cookies set by AppMeasurement typically have an expiration of 2 years. Use the cookieLifetime
variable to override the expiration date for cookies set by AppMeasurement.
NOTE
This variable impacts unique visitor counts and attribution. Use caution when setting this variable.
Cookie Lifetime using the Web SDK
The Web SDK does not yet offer customization to the lifetime of cookies that it sets.
Cookie Lifetime using the ÃÛ¶¹ÊÓƵ Analytics extension
Cookie Lifetime is a drop-down list under the Cookies accordion when configuring the ÃÛ¶¹ÊÓƵ Analytics extension.
- Log in to using your ÃÛ¶¹ÊÓƵID credentials.
- Click the desired tag property.
- Go to the Extensions tab, then click the Configure button under ÃÛ¶¹ÊÓƵ Analytics.
- Expand the Cookies accordion, which reveals the Cookie Lifetime drop-down list.
This drop-down list contains the following values:
- Default: Cookie expires after 2 years.
- None: AppMeasurement does not set cookies.
- Session: Cookie expires at the end of the visitor’s session.
- Seconds: Cookie expires after the specified number of seconds have elapsed. For example, setting this drop-down list to Seconds and placing
86400
into the custom field forces cookies to expire after exactly 24 hours.
s.cookieLifetime in AppMeasurement and the Analytics extension custom code editor
The s.cookieLifetime
variable is a string that determines the expiration date of cookies set by AppMeasurement.
- If set to
SESSION
, cookies set by AppMeasurement expire after the browser session completes. - If set to
NONE
, AppMeasurement does not attempt to set cookies. - If set to an integer string, cookies set by AppMeasurement expire after the specified number of seconds have elapsed.
// Expire cookies after each session
s.cookieLifetime = "SESSION";
// Expire cookies after exactly 24 hours
s.cookieLifetime = "86400";
recommendation-more-help
b4f6d761-4a8b-4322-b801-c85b9e3be690