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.

To disable Advertising Features with gtag.js completely on a given web page, use the set command to set allow_ad_personalization_signals to false before any config commands:

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

To disable Advertising Features with gtag.js only for a specific property, use the config command for the given GA_MEASUREMENT_ID to set allow_ad_personalization_signals to false:

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