We’ve migrated our documentation to a new site, which means some URLs have changed.
Analytics

How to edit the cookies' lifetime? (first-party)

The configuration of the lifetime of first-party cookies is embedded in your JavaScript file regardless of the version of your tag.

Piano-analytics.js

Versions before 6.8.0

You can change the lifetime of cookies by setting a new value for the following configuration keys:

  • storageLifetimePrivacy for the consent cookie.

  • storageLifetimeUser for the user cookie (user_id).

  • storageLifetimeVisitor for the unique visitor cookie (visitor_id).

More information is available in our online documentation: SDK configuration.

Those keys cover the cookies pa_privacy, pa_user and pa_vid.

Versions above 6.8.0

You can change the lifetime of cookies by adding the desired configuration to the object window.pdl.cookies.

For example:

window.pdl = window.pdl || {};
window.pdl.cookies = {
  _pprv: {
    expires: 183 //Set 183 days only for _pprv cookie
  }
};

This cover all of the following cookies: _pprv, _pctx, _pcid. You can find further information in the following documentation: Consent Management for Client Storage (Cookies)

Last updated: