Expand my Community achievements bar.

Announcement: Adobe Analytics Mentorship Program 2023! Join now to prepare to get an Adobe Analytics certification with an expert mentor!

RGPD - cookieLifetime  - write custom code to set a date on which to delete the cookie


Level 2



Currently we use cookieLifetime  variable to set the Adobe cookie limit on our website.


Seen with the new rules of RGPD, we fixed the expiry to 13 months to abide by the law.


Now we need to add a setting to make the cookies' expiry date not get renewed on every visit.


So for example : 


Visitor X : 

Visit 1 - 02/01/2022 : Cookie expires in 13 months - expiry date : 02/02/2023

Visit 2 - 12/03/2022 : Cookies already exist - expiry date shouldn't be renewed - cookies still have to expire on 02/02/2023


I checked the Adobe documentation, all I found is this:


  • 13-month cookie limit. You can override your analytics cookie expiration using the cookieLifetime variable. Experience Cloud cookies including Analytics and ECID extend the cookie expiration date with each visit. To set a static, non-rolling cookie expiration, you can either: (1) write custom code to set a date on which to delete the cookie, or (2) use your CMP to control the date of the cookie reset. cookieLifetime and Experience Cloud Cookies

Source : https://experienceleague.adobe.com/docs/analytics/admin/data-governance/cnil-consent-exemption.html?...



Has anyone ever done this using the first solution? As I am not able to find more information online.


Thank you


3 Replies


Employee Advisor

You may set an static expiry date by setting a string integer.

s.cookieLifetime = "86400";


See https://experienceleague.adobe.com/docs/analytics/implementation/vars/config-vars/cookielifetime.htm....



Level 2



I think you misunderstood my question.


We already assign cookieLifetime to 13 months in a string integer.


What I meant in my question is, how do I avoid that the cookie renews 13 months at every visit of the same user?

Thank you


Community Advisor

Since this is a limitation in AppMeasurement or ECID itself, I don't think there's anything that you can do. You'll have to consult Adobe Client Care to see if they can get engineering to update their code to allow you to specify an expiry that never changes.