Optimize your Google Ads spending with AI
Universal Analytics Cookie Durations
Google Analytics uses two main types of cookies for Universal Analytics properties:
- First-party cookies: Set by the website domain itself. These cookies have a default expiration of 2 years from the date they are set.
- Third-party cookies: Set by the
googleanalytics.com
domain. These cookies expire after 6 months.
The specific durations for Universal Analytics cookies are:
_ga
: Used to distinguish users; expires after 2 years._gid
: Used to distinguish users; expires after 24 hours._gat
: Used to throttle request rate; expires after 1 minute.AMP_TOKEN
: Contains a token that can be used to retrieve a Client ID from AMP Client ID service; expires after 30 seconds to 1 year.
Website owners can adjust the data retention settings in their Google Analytics account to control how long user-level and event-level data is stored before being automatically deleted:
- 14 months
- 26 months
- 38 months
- 50 months
- Do not automatically expire
This setting does not affect standard aggregated reporting in Google Analytics.
Google Analytics 4 (GA4) Cookie Durations
Google Analytics 4 (GA4) uses a different set of cookies compared to Universal Analytics. The main GA4 cookies and their durations are:
_ga
: Used to distinguish users; expires after 2 years._ga_<container-id>
: Used to persist session state; expires after 2 years._gid
: Used to distinguish users; expires after 24 hours._gac_gb_<container-id>
: Contains campaign related information; expires after 90 days.
In GA4, there is no limit to how long a session can last. This differs from Universal Analytics, where sessions timeout after 30 minutes of inactivity. GA4 doesn't create a new session based on a timeout, but rather based on a session_start event.
GA4 also offers the ability to activate Google signals, which enables cross-device reporting and more granular ad targeting. When Google signals are active, additional data may be collected using Google advertising cookies that are present on the website.
The User lifetime feature in GA4 allows you to analyze user behavior and value over their lifetime as a customer. This technique shows how users behaved during their entire engagement with your website or app, rather than just individual sessions.
Understanding how long Google Analytics cookies last—both in Universal Analytics and GA4—is crucial for accurately tracking user behavior and complying with data privacy regulations.
Balancing Data Needs and Privacy Compliance
Understanding the duration of Google Analytics cookies is essential for website owners and marketers who want to effectively track user behavior while respecting privacy concerns. By knowing how long these cookies persist, you can make informed decisions about data retention and comply with relevant regulations such as GDPR and CCPA.
Website owners should regularly review their Google Analytics settings to ensure they align with their data needs and privacy policies. This may involve adjusting cookie expiration times or data retention settings to strike the right balance between gathering valuable insights and protecting user privacy.
As Google shifts focus to Google Analytics 4 (GA4), it's important to stay informed about the changes in tracking technologies. GA4 introduces new features like event-based tracking, cross-device reporting, and the User lifetime technique, which can provide a more comprehensive view of user behavior over time.
However, these advancements also come with new considerations for data privacy. Website owners must be transparent about their use of cookies and provide clear opt-in/opt-out mechanisms for users. They should also regularly review and update their privacy policies to reflect any changes in data collection practices.
By staying informed about Google Analytics cookie durations and adapting to new tracking technologies like GA4, website owners can make data-driven decisions while prioritizing user privacy. This approach not only helps maintain trust with website visitors but also ensures compliance with evolving data protection regulations.