Thanks for previewing Google's new tag documentation! This site is in public beta. (Feedback)

Manage user privacy

At Google, we are keenly aware of the trust you place in us and our responsibility to keep your privacy and data secure. As part of this responsibility, we provide information and tools that developers can use to help enable and manage user privacy.

Cookies

Google uses different types of cookies to operate various advertising and measurement products. Some or all of the cookies may be stored in your browser. You can view and manage cookies in your browser, though certain mobile device apps may not offer this visibility.

To learn more about how to manage cookie settings from Google tags, read Cookies and user identification.

Refer to the Google advertising and measurement cookie reference for information on specific cookie behavior.

Google uses several configuration parameters to manage privacy and consent. These parameters give you the ability to control how such data is handled.

gtag.js

Privacy control Compatible products Description How to validate on the client side
allow_google_signals Universal Analytics, Google Analytics 4 No effect when not set or set to true. When set to false, events sent from the tag will not be used for ads personalization and demographics and interests reports. No effect when not set or set to true. When set to false, all join beacons are suppressed.
allow_ad_personalization_signals Universal Analytics, Google Analytics 4, Floodlight No effect when not set or set to true. When set to false, events sent from the tag will not be used for ads personalization, but they can still be used for demographics and interests reporting No effect when not set or set to true. When set to false, include an &npa=1 parameter on all beacons.
restricted_data_processing Google Ads No effect when not set. When set to true, Google will limit how it uses the events sent from the tag. Certain features will be unavailable, including adding users to remarketing lists, adding users to similar audience remarketing seed lists, and related functionality. No effect when not set. When set to true, an &rdp=1 parameter is included in beacons. When set to false, an &rdp=0 parameter is included in beacons.
consent Universal Analytics, Google Analytics 4, Google Ads, Floodlight

Tag Manager

Privacy control Compatible tag templates Description How to validate on the client side
allowAdFeatures Universal Analytics Set in "Fields to set". No effect when not set or set to true. When set to false, events sent from the tag will not be used for ads personalization and demographics and interests reporting No effect when not set or set to true. When set to false, all join beacons are suppressed.
allow_google_signals Google Analytics 4 Configuration Set in "Fields to Set" No effect when not set or set to true. When set to false, events sent from the tag will not be used for ads personalization and demographics and interests reporting No effect when not set or set to true. When set to false, all join beacons are suppressed.
allowAdPersonalizationSignals Universal Analytics Set in "Fields to Set" No effect when not set or set to true. When set to false, events sent from the tag will not be used for ads personalization, but they can still be used for demographics and interests reporting. No effect when not set or set to true. When set to false, include an &npa=1 parameter on all beacons.
allow_ad_personalization_signals Google Analytics 4 Configuration Set in "Fields to Set" No effect when not set or set to true. When set to false, events sent from the tag will not be used for ads personalization, but they can still be used for demographics and interests reporting No effect when not set or set to true. When set to false, include an &npa=1 parameter on all beacons.
restricted_data_processing Google Ads Conversion Tracking Set it in the control "Enable Restricted Data Processing" in Tag Manager's Google Ads Conversion Tracking tag. No effect when not set or set to false. When set to true, Google will limit how it uses the events sent from the tag. Certain features will be unavailable, including adding users to remarketing lists, adding users to similar audience remarketing seed lists, and related functionality. No effect when not set or set to false. When set to true, an &rdp=1 parameter is included in beacons. When set to false, an &rdp=0 parameter is included in beacons.

Consent mode allows you to adjust how your Google tags behave based on the consent status of your users. You can indicate whether consent has been granted for Analytics and Ads cookies. Google's tags will dynamically adapt, only utilizing cookies for the specified purposes when consent has been given by the user.

Products that support consent mode include:

  • Google Ads*
  • Floodlight
  • Google Analytics

* includes Google Ads Conversion Tracking and Remarketing; support for Phone Call Conversions pending.

Once consent mode is deployed, it will adjust the behavior of these types of pings:

  • Consent status pings: Consent status pings are sent from each page the user visits where consent mode is implemented, as well as if the consent state changes (e.g., if the user opts in). These pings communicate the consent state (i.e. granted or denied) for each consent type (e.g. ad storage, analytics storage).
  • Conversion pings: Conversion pings are sent to indicate that a conversion has occurred.
  • Google Analytics pings: Google Analytics pings are sent on each page of a website where Google Analytics is implemented and upon events being logged.

When consent is granted, the associated tags will function normally.

When consent for ad storage or analytics storage is denied, the associated Google tags deployed via a global site tag or Google Tag Manager will adjust their behavior accordingly.

In all cases, pings may include:

  • Functional information (such as headers added passively by the browser):
    • Timestamp
    • User Agent
    • Referrer
  • Aggregate / non-identifying information:
    • An indication for whether or not the current page or a prior page in the user's navigation on the site included ad-click information in the URL (e.g., GCLID / DCLID)
    • Boolean information about the consent state
    • Random number generated on each page load

Additionally, consent and conversion pings may include the following behaviors depending on the state of the consent settings and the configuration of your tags.

There is only one set of behaviors for when all consent options are granted:

ad_storage='granted' and analytics_storage='granted' (default):

  • Cookies pertaining to advertising may be read and written.
  • IP addresses are collected.
  • The full page URL, including ad-click information in URL parameters (e.g., GCLID / DCLID) is collected.
  • Third-party cookies previously set on google.com and doubleclick.net, and first-party conversion cookies (e.g., _gcl_*) are accessible.

When one or more forms of consent are not granted, there are additional behaviors to consider:

ad_storage='denied':

  • No new cookies pertaining to advertising may be written.
  • No existing first-party advertising cookies may be read.
  • Third-party cookies previously set on google.com and doubleclick.net may be sent in request headers (but limited to use for spam and fraud purposes).
  • Google Analytics will not read or write Google Ads cookies, and Google signals features will not accumulate data for this traffic.
  • Ads products truncate IP addresses at collection.
  • Full page URLs are collected, including ad-click information in URL parameters (e.g., GCLID / DCLID).

Implementation:

gtag.js

Call the default command before a global site tag or Tag Manager runs to adjust how the tags operate. Modify the defaults according to your business requirements and prior consent status:

gtag('consent', 'default', {'ad_storage': 'denied'});

To update consent based on a user-initiated change:

gtag('consent', 'update', {'ad_storage': 'granted'});

Learn more about consent configuration

Tag Manager

Tag Manager implementations must use a global site tag to manage consent. Learn more.

ad_storage='denied' + ads_data_redaction=true:

  • No new cookies pertaining to advertising may be written.
  • No existing advertising cookies may be read.
  • Requests are sent through a different domain to avoid previously set third -party cookies from being sent in request headers.
  • Google Analytics will not read or write Google Ads cookies, and Google signals features will not accumulate data for this traffic.
  • Ad-click identifiers (e.g., GCLID / DCLID) in consent and conversion pings are redacted.
  • Ads products truncate IP addresses at collection.
  • Page URLs with ad-click identifiers are redacted.

Implementation:

To further redact your ads data when ad_storage is 'denied', you can optionally choose to set the value of the ads_data_redaction parameter to true:

gtag.js

gtag('set', {'ads_data_redaction', true});

Tag Manager

Tag Manager implementations must use a global site tag to manage consent. Learn more.

analytics_storage='denied':

  • Will not read or write first-party analytics cookies.
  • Cookieless pings will be sent to Google Analytics for basic measurement and modeling purposes.

Implementation:

gtag.js

gtag('consent', 'default', {'analytics_storage': 'granted'});

Tag Manager

Tag Manager implementations must use a global site tag to manage consent. Learn more.

Disable Advertising Features

Because advertising features can be enabled through your Google Analytics admin settings, there may be cases where you need to disable them programmatically. If you’ve configured Connected Site Tags, you’ll need to follow these instructions if you wish this signal to propagate to your Connected Site Tags.

Disable all advertising features

These configurations give you the ability to disable advertising, reporting, and remarketing features, and overrides any property settings established in the Google Analytics user interface.

To disable all advertising features with the global site tag for Universal Analytics and Google Analytics 4, set allow_google_signals to false:

gtag.js

gtag('set', {'allow_google_signals', false});

Tag Manager

To disable all advertising features across all properties, use the global site tag method.

To disable advertising features with a global site tag on a specific Google Analytics Google Analytics 4 property, edit the config command for the given G-XXXXXX and set allow_google_signals to false:

gtag.js

gtag('config', 'G-XXXXXX', { 'allow_google_signals': false });

Tag Manager

In Tag Manager:

  1. Open your Google Analytics Google Analytics 4 configuration tag for editing.
  2. Click Fields to Set.
  3. Click Add Row.
  4. For Field Name, enter allow_google_signals, and for Value enter false.

Disable advertising personalization

These configurations give you the ability to disable advertising personalization features. Setting the allow_ad_personalization_signals parameter applies the setting to all products configured through the global site tag, and an npa=1 parameter is added to the tag URL to indicate that only non-personalized ads are allowed.

To disable all advertising personalization with a global site tag, set allow_ad_personalization_signals to false:

gtag.js

gtag('set', {'allow_ad_personalization_signals', false});

Tag Manager

To disable all advertising features across all properties, use the global site tag method.

To disable advertising personalization with a global site tag on a specific Google Ads, Google Analytics, or Floodlight configuration, edit the config command for the given G-XXXXXX and set allow_ad_personalization_signals to false:

gtag.js

gtag('config',  {'allow_ad_personalization_signals': false });

Tag Manager

In Tag Manager:

  1. Open your Google Analytics tag for editing.
  2. Click Fields to Set.
  3. Click Add Row.
  4. For Field Name, enter allow_ad_personalization_signals, and for Value enter false.

Disable Google Analytics

In some cases, it may be necessary to disable Google Analytics. For example, you might do this if your site's privacy policy provides an option for the user to opt-out of Google Analytics.

The global site tag library includes a window['ga-disable-MEASUREMENT_ID'] property that, when set to true, disables the global site tag from sending data. When a product attempts to set a cookie or send data back to the Google Analytics servers, it will first check if this property is set, and will take no action if the value is set to true.

gtag.js

To disable Google Analytics programmatically, set window['ga-disable-MEASUREMENT_ID'] to true. Replace G-XXXXXX with a valid Google Analytics measurement ID:

<script>
window['ga-disable-MEASUREMENT_ID'] = true;
<script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXX');
</script>

Tag Manager

To prevent the Google Analytics tag from firing, use a trigger condition to check if a user has opted out, and fire the tag based on the value of the trigger condition. For example, here is a configuration that uses a first-party cookie to determine if it can fire an Analytics tag. These instructions assume that you have already created a Google Analytics tag.

Note: This method does not use window['ga-disable-MEASUREMENT_ID'], but instead provides a straightforward solution tailored for Tag Manager implementations.

  1. In your page's JavaScript source, set a cookie called "google-analytics-opt-out", give it a value of true, and set it to expire at some date far into the future. For example:
    document.cookie = 'google-analytics-opt-out=true; expires=Mon, 1 Jan 2170 23:59:59 UTC; path=/';
  2. In Tag Manager, create a new variable that checks for the google-analytics-opt-out cookie:
    1. Click Variables > New.
    2. Set Variable Type to 1st-Party Cookie.
    3. Name the variable "google-analytics-opt-out cookie" and click Save.
  3. Create a new trigger for a Google Analytics tag:
    1. Set Trigger Type to Page View.
    2. Set This trigger fires on to Some Page Views.
    3. Set Fire this trigger when an Event occurs and all of these conditions are true to read "google-analytics-opt-out cookie does not equal true"
  4. Click Save.
  5. Publish your container.

Disable default page view measurement in Google Analytics

The default behavior of the Google Analytics tag is to send a page_view event to Google Analytics. This is the desired behavior in most cases; page_view events are automatically recorded once you add the code to each page on your site. However, if you don’t want the tag to send a page_view event to Google Analytics, set the send_page_view parameter to false:

gtag.js

gtag('set', { 'send_page_view': false });

Tag Manager

  1. Open any relevant Google Analytics 4 Configuration tag.
  2. Uncheck the option labeled Send a pageview event when this configuration loads.

Restricted data processing

When you enable restricted data processing, Google will limit how it uses data. Certain features will be unavailable, including adding users to remarketing lists, adding users to similar audience remarketing seed lists, and related functionality. For App campaigns, enabling restricted data processing may mean that the users who install your app will continue to see ads for that app following installation. Learn more.

To enable restricted data processing:

gtag.js

Add a restricted_data_processing parameter with a value of true to your tag:

< ! -- Global Site Tag (gtag.js) -  Product -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer | | [ ] ;
  function gtag ( ) { dataLayer.push ( arguments ) } ;

  gtag ( 'js', new Date ( ) ) ;
  gtag ( 'set', { 'restricted_data_processing': true });
</script>

Tag Manager

  1. Sign in to Google Tag Manager.
  2. Click Tags in the left column to access your tags.
  3. Create or edit a tag that supports restricted data processing (Google Ads Remarketing, Google Ads Conversion, etc.)
  4. In the tag configuration section, select True for the field "Enable Restricted Data Processing."
  5. Alternatively, this field can be set dynamically via a data layer variable.
  6. Click Save.

The IAB Transparency & Consent Framework (TCF) is an open-standard technical framework that enables websites, advertisers and ad agencies to obtain, record, and update consumer consent for web pages. Google Analytics integrates with TCF version 2 to control advertising features for customers using gtag.js or Google Tag Manager. Learn more about IAB TCF for Google Ads or Google Analytics.

IAB CCPA data processing

Google is not currently a signatory to the IAB Privacy’s Limited Service Provider Contract. We have however integrated with the IAB CCPA Framework v1.0 Technical Specifications for the Google Ads remarketing and conversion tags to read the us_privacy string on advertisers' websites.

Advertisers who choose to use the IAB signal should follow the technical specification provided by the IAB Tech Lab to implement the us_privacy string on their pages. Our Google Ads tags will interact with the advertisers page to retrieve the us_privacy string and apply restricted data processing when the string indicates a user has opted out.

  • When the IAB string indicates a user has not opted out, there will be no changes to behavior.
  • When the IAB string indicates a user has opted out, Google will enable restricted data processing.