About the _gac and _gcl cookies
Google Analytics writes various cookies to send data associated with your users. The _gac
and _gcl
cookies store campaign information in order to provide Google Ads with a more reliable way to measure the interactions customers have with your business. Analytics writes campaign information to the _gac
and _gcl
cookies when a user opens a page on your site via a URL that employs Google Ads auto-tagging.
Cookie name and value
A separate cookie is written for each Analytics property.
The cookie name includes the property ID. For example:
"_gac_UA-123456-12"
("_gac_property ID")
"_gcl_GB-123456-12"
("_gcl_property ID")
The _gac
cookie value contains a version number followed by a timestamp, and campaign information in the form of a GCLID value. For example:
"1.123456789.CM-a9evq8dFDGUNR8BpeUWxBZB"
("version number.timestamp.gclid value")
Cookie settings
You can modify the cookie name, domain, and expiry using the same cookie-field settings you use for other cookies written by your tags. Learn more
Cross-domain measurement
Your tags will send the _gac
and _gcl
cookies along with all cross-domain measurement parameters unless cookie writing is disabled as outlined below.
Effect on data
Analytics
The _gac
and _gcl
cookies do not affect Analytics data or the way the data appears in Analytics reports.
Google Ads
If you have auto-tagging enabled, Google Ads adds a unique parameter, the GCLID or “Google click identifier”, to your landing-page URLs.
Google Ads conversion tags on your website use the _gac
cookie to obtain GCLID information when the user converts, which improves the accuracy of its conversion measurement. Learn more
While all Google Ads conversion tags read and send this information by default, the data is immediately discarded server side if the Google Ads account that owns the tag is not linked to the Analytics property that stored the data in the cookie.
If you do not want Analytics to set the _gac
and _gcl
cookie, you can opt out by following the instructions in the next section.
How to opt out
gtag.js
To opt out, include the following line in your tag:
gtag('config', 'UA-XXXXX-Y', {'store_gac': false});
analytics.js
analytics.js sets the _gac cookie by default. To opt out, add the following line to your tag:
ga('create', 'UA-XXXXX-Y', 'auto', {'storeGac': false});
Google Tag Manager
Use an existing published tag container.
- Navigate to Fields to set Tag Configuration.
- To opt out, set
storeGac
to false. - Save the tag configuration and publish the container.
Legal notice
As always, make sure that you provide your users with clear and comprehensive information about data that you may collect on your websites, and, where required, get consent for the collection of that information.