Advertising cookie · Google AdSense

__gads Cookie: What It Is, Who Sets It, and Consent Rules

Last verified 2026-10-17 · Updated 2026-10-17

On this page
  1. What the __gads cookie does
  2. Who sets the __gads cookie
  3. Does the __gads cookie need consent?
  4. How to block the __gads cookie
  5. How long the __gads cookie lasts
  6. Cookies that work with __gads
  7. Scripts and requests of Google AdSense
  8. Changes to the __gads cookie
  9. __gads cookie FAQs

What the __gads Cookie Does on Your Site

The __gads cookie is a first-party advertising cookie that Google AdSense sets on the domain of the publisher to show ads and limit how often a visitor sees an ad. The __gads and __gpi cookies are "first-party cookies set on the publisher's domain" that support "frequency capping and ads personalization", according to the Google Ad Manager help. The __gads cookie holds an ID for ad serving, and Google states that the __gads cookie "is not allowed for personalization usages". The __gpi cookie carries the ID for personalized ads instead.

Google lists the __gads cookie in the categories Advertising and Security, with a lifetime of 13 months, on the Google list of advertising cookies. The __eoi cookie of the same AdSense code serves security only and lasts 6 months.

__gads cookie facts
Cookie name__gads
VendorGoogle AdSense
CompanyGoogle LLC (Google Ireland Limited for visitors in the EU)
CategoryAdvertising
PartyFirst-party
DomainYour own root domain, for example .example.com
Set byNot documented
Retention13 months (395 days)
HttpOnlyNo
SecureNot documented
SameSiteNot documented
Cookie Consent categorytargeting
Privacy Consent vendor categoryAdvertising (advertising)

Who Sets the __gads Cookie

The AdSense code (adsbygoogle.js) sets the __gads cookie on the domain of your site, where Google calls the cookie a first-party cookie set on the domain of the publisher. Google Ad Manager sets the same __gads cookie on the sites of publishers that run Google Ad Manager.

Google lists the __gads cookie in the Advertising and Security categories on the Google list of advertising cookies. The list marks the cookie as set from the partner domain, the domain of your site. A cookie scanner therefore reports the __gads cookie under your own domain.

Read how Google LLC handles the data in the Google AdSense privacy policy, and sign the Google Ads Controller-Controller Data Protection Terms before you collect data from visitors in the EU or the UK. Both documents appear in the sources at the end of this page.

How to Block the __gads Cookie Until Visitors Accept

Block the __gads cookie by holding back the AdSense code (adsbygoogle.js) until the visitor accepts advertising cookies. TermsFeed Free Cookie Consent and TermsFeed Privacy Consent place Google AdSense in the advertising category. Check whether an exemption applies to your own use of Google AdSense in the consent rules for the __gads cookie.

Google AdSense writes no __gads cookie while the AdSense code waits as a tagged script, and the ad units of the page stay empty for a visitor who declines.

Block the __gads Cookie With TermsFeed Free Cookie Consent

TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="targeting", the Cookie Consent category for advertising cookies. The tagged the AdSense code (adsbygoogle.js) looks like this.

<script type="text/plain" data-cookie-consent="targeting" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-YOUR_PUBLISHER_ID" crossorigin="anonymous"></script>

Cookie Consent runs the tagged code after the visitor clicks "I agree" or accepts the targeting category in the Preferences Center. The illustration shows the consent banner and the script it releases.

The TermsFeed Free Cookie Consent banner: (1) the visitor clicks "I agree", (2) Cookie Consent runs the script tagged targeting. Illustration of the consent banner.

Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.

Block the __gads Cookie With TermsFeed Privacy Consent

Add Google AdSense from its template in TermsFeed Privacy Consent and type your publisher ID, which starts with ca-pub-. The AdSense code loads only after the visitor accepts the Advertising vendor category, and Privacy Consent sends the Google Consent Mode v2 signals for you.

Privacy Consent is not a Google-certified TCF consent management platform and writes no TCF string. Use a certified CMP for personalized AdSense ads in the EEA, the UK, and Switzerland, where AdSense otherwise serves non-personalized ads or limited ads at most.

The Google AdSense template asks for the Publisher ID and fills every other field of the vendor. Pick the "Google AdSense" card under Advertising, enter the Publisher ID, and click "Add Google AdSense". Find the Publisher ID in AdSense under Account › Settings › Account information; the ID starts with ca-pub-. The illustration shows the template form in the TermsFeed app.

The Google AdSense template in TermsFeed Privacy Consent: (1) pick the card, (2) enter the Publisher ID, (3) click "Add Google AdSense". Illustration of the TermsFeed app.

Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up Google AdSense from its template with TermsFeed Privacy Consent.

Block the __gads Cookie With Google Consent Mode v2

Google Consent Mode v2 tells Google whether the visitor allows ad_storage, ad_user_data, and ad_personalization. Google sets no new advertising cookies while ad_storage is denied, according to the Google tag platform guide on consent mode. Set all 3 to denied by default and update them to granted once the visitor accepts advertising cookies.

AdSense needs more than Google Consent Mode v2 for personalized ads in the EEA, the UK, and Switzerland. Google requires a Google-certified consent management platform (CMP) integrated with the IAB Transparency and Consent Framework (TCF), according to the AdSense help on consent management requirements. The requirement applies since 16 January 2024 for the EEA and the UK, and since 31 July 2024 for Switzerland.

Set up the default and the update calls with how to integrate Google Consent Mode v2 with Cookie Consent.

Stop the __gads Cookie in AdSense

Turn off "allow first-party cookies from Google" in AdSense under Brand safety, Content, Blocking controls, and Manage ad serving to stop the __gads and __gpi cookies on your domain. Google combined the cookie setting with the ad personalization setting on 12 November 2024, according to the AdSense help.

The setting stops the first-party cookies of AdSense only. The AdSense code still loads from Google and still sends requests to the domains of Google, so the AdSense code needs consent with the setting off as well.

How to Verify That the __gads Cookie Waits for Consent

Verify the setup in a private window. Open Chrome DevTools, select the Application tab, and open Cookies. Click "I decline" on the consent banner and reload the page. The __gads cookie must not appear in the list until you accept advertising cookies.

How Long the __gads Cookie Lasts

The __gads cookie lasts 13 months (395 days).

The __gads cookie has "a max-age of 13 months", according to the Google Ad Manager help on publisher first-party IDs, and the Google list of advertising cookies gives 13 months as well. The 13 months stay within the 400 days that Chrome allows for any cookie.

Scripts and Requests of Google AdSense That Come With the __gads Cookie

The catalog lists 1 scripts, pixels, and data endpoints of Google AdSense, which a cookie scanner or the Network tab of Chrome DevTools shows next to the __gads cookie. Block the main script, and the requests in the table stop with the main script.

TypeResourceHostWhat it does
ScriptAdSense code (adsbygoogle.js)pagead2.googlesyndication.comThe AdSense code loads from pagead2.googlesyndication.com, fills the ad units of the page, and writes the __gads and __gpi cookies.

Changes to the __gads Cookie

The catalog records 2 dated changes that affect the __gads cookie. The newest change comes first.

DateChange
16 January 2024Google started to require a Google-certified CMP integrated with the TCF for AdSense ads in the EEA and the UK, and added Switzerland on 31 July 2024.
12 November 2024Google combined the first-party cookie setting and the ad personalization setting of AdSense into a single control.

__gads Cookie FAQs

Is __gads a necessary cookie?

No, the __gads cookie is not a strictly necessary cookie. Firstly, your site works the same for a visitor who refuses the __gads cookie, apart from the ads. Secondly, Google uses the cookie for ad serving and frequency capping, purposes the ePrivacy Directive exemption does not cover. Thirdly, Google itself offers a setting in AdSense that stops the first-party cookies of AdSense.

What is the difference between __gads and __gpi?

The __gads cookie holds an ID for ad serving, and the __gpi cookie holds the ID that Google uses for personalized ads. The __gads cookie "is not allowed for personalization usages", and both cookies last 13 months, according to the Google Ad Manager help.

Does AdSense need a certified CMP?

Yes, AdSense needs a Google-certified CMP integrated with the TCF for personalized ads in the EEA, the UK, and Switzerland. Firstly, Google requires the certified CMP since 16 January 2024 for the EEA and the UK. Secondly, Google added Switzerland on 31 July 2024. Thirdly, traffic from a CMP without certification "may be eligible for non-personalized ads or limited ads", according to the AdSense help on consent management requirements.

How long does the __gads cookie last?

The __gads cookie lasts 13 months, according to the Google Ad Manager help. Chrome keeps every cookie for 400 days at most, a cap that leaves the 13 months of the __gads cookie unchanged.

Sources for the __gads Cookie

The facts on this page come from the documentation Google publishes, checked on 2026-10-17. The catalog lists every source so you check each fact yourself.