This article is about Google Analytics 4 properties. If you're using a Universal Analytics property, refer to the Universal Analytics section of this help center.

[GA4] Cookie usage on websites

This article is about cookies usage for Google Analytics 4 properties. To learn about cookies for Universal Analytics, see this article instead.

The gtag.js JavaScript library uses first-party cookies to distinguish unique users as well as unique sessions from a single user. The library does not require you to set cookies to transmit data to Google Analytics. To learn how to customize the default settings, see Cookies and user identification.

gtag.js cookies

The following table describes each cookie set by gtag.js. To learn more about the data that Analytics collects, see Safeguarding your data.

Cookie name Default expiration time Description
_ga 2 years Used to distinguish users.
_gid 24 hours Used to distinguish users.
_ga_<container-id> 2 years Used to persist session state.
_gac_gb_<container-id> 90 days Contains campaign related information. If you have linked your Google Analytics and Google Ads accounts, Google Ads website conversion tags will read this cookie unless you opt-out. Learn more.
Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
69256
false