Disable cookies on a per request basis

You can disable cookies on a per request basis for Google-hosted image ads. Disabling cookies on a per request basis allows you to customize your overall use of cookies and enable per user control of them.

When you use this feature in an ad request, any cookies set on the doubleclick.net domain that are already stored in the user's browser will still be accessed and sent to Google, but they will be ignored. No new HTTP cookies will be served by the ad server on the request. Note that only Google-hosted image creatives can be served using this feature.

Cookies cannot be disabled for clicks or advertiser-facing features such as creating remarketing user lists. There is no effect on mobile device ID usage.

Disabling cookies only prevents cookies related to Ad Manager ad serving from being used. Any other ad tags or web requests made from your site outside of Ad Manager can result in cookies being used. For example, if you embed YouTube videos, add G+ buttons on your page, or use other such ad products on your pages, cookies will not be disabled.

The guidelines below describe how to disable cookies for different Ad Manager tags. As with any tagging change, please be sure to verify the results are as expected after making the change.

What happens when you disable cookies

When you disable cookies for an ad request, then for that request only:

  1. All incoming cookies will be ignored. The ad server will treat the request as removed from targeted advertising and will not issue any new cookies.

  2. The following will be disabled:

    • Creative types other than Google hosted image ads, such as GPT passbacks or GMob internal redirects
    • Dynamic allocation
    • Creation of all doubleclick.net cookies
    • Features that use cookies, including frequency capping and sequential creative rotation. Line items with these enabled will not be eligible for the ad request.
  3. Delayed impression URLs returned in response to requests with cookies disabled will also ignore cookies. Static content serving and Active View reporting are cookieless.

You cannot disable cookies for the following events or features:

  • Clicks: Cookies are not disabled on clicks. For example, if a request includes co=1 and the user clicks an ad, the user may receive a new cookie.
  • View-through conversions: If cookies are disabled on an ad impression request, Ad Manager cookies will not be included in ad impression logs. Therefore, Ad Manager will not be able to attribute a view-through conversion even if the advertiser sent a conversion event for the ad impression.
  • Static click tracking ads: Ad Manager does not disable cookies for static tracking, such as that used for click tracking line items. Static tracking is used for reporting clicks from ads in newsletters or mail, or ads that are served directly from the customers' web servers or media servers.
  • Conversions: Advertisers should not send conversion events to Ad Manager if the user has disabled cookies.

    Conversions might not be enabled for your network.

Google Publisher Tags (GPT)

If you're using GPT, you can disable cookies in each ad request that follows by using the following API call:

googletag.pubads().setCookieOptions(int options);

Set the options parameter to the integer value 1 to ignore cookies, and to 0 to use cookies. Learn more about setCookieOptions in the developer documentation.

To ensure the cookie options you specify take effect before any ads are requested for the page, make the setCookieOptions call the first GPT API call that your page executes. For example, you need to ensure your call to setCookieOptions is run before any call to googletag.enableServices(), googletag.pubads().display(...), and googletag.pubads().definePassback(...).display() (not an exhaustive list).

If you're using asynchronous mode, subsequent calls to refresh any ad slots (using googletag.pubads().refresh) will take into account changes made using setCookieOptions since the last request for the ad slot.

Example asynchronous GPT code snippet
<script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script type="text/javascript">
  googletag.cmd.push(function() {
    googletag.defineSlot('/1234/travel', [728,90], 'div1').addService(googletag.pubads());
Example GPT passback code snippet
<script src='https://www.googletagservices.com/tag/js/gpt.js'>
  googletag.pubads().setCookieOptions(1).definePassback('/1234/travel', [728,90]).display();

Simple URLs

If you're using simple URLs, you can disable cookies by adding the co=[int] parameter directly to the tag request URL. You must specify the parameter early in the tag; to be safe, put it in the first 500 characters. Specify co=1 to ignore cookies or co=0 to use cookies. For example:


The ad server will ignore the parameter if sent for click requests using simple URLs.

Was this article helpful?
How can we improve it?