Enable Remarketing and Advertising Reporting Features in Google Analytics

To take advantage of Remarketing with Google Analytics and Remarketing Lists for Search Ads with Google Analtyics, you need to turn on Remarketing.

To see data in the Demographics and Interests reports, see GDN Impression data in the Multi-Channel Funnel reports, and take advantage of DoubleClick platform integrations, you need to enable Advertising Reporting Features.

In addition, you also need to adhere to the Policy requirements for Google Analytics Advertising Features.

In this article:

Enable Remarketing and Advertising Reporting Features for a web property

When you enable Advertising Features for a web property, Google Analytics collects the information it normally does, as well as Google advertising cookies when those cookies are present.

You can enable Advertising Features for a web property by:

Modify your property settings

This method applies only to web properties.

When you modify your property settings to support Remarketing and/or Data Collection for Advertising Features, then traffic to all your pages is subject to this type of data collection. If you want to implement these features for only portions of your site, then you need to modify the tracking code for each relevant page, and leave these property settings off.

To update your property settings:

  1. Sign in to your Google Analytics account.
  2. Select the Admin tab and navigate to the account and property for which you want to enable these features.
  3. In the Property column, click Tracking Info, then click Data Collection.
  4. Under Data Collection for Advertising Features:
    • To enable Remarketing, set Remarketing and Advertising Reporting Features to ON.
    • To enable only the Advertising Reporting Features, set only Advertising Reporting Features to ON.

If you have previously enabled Display Remarketing and the Advertising Reporting Features by updating your tracking code, you can still implement these property settings and not incur any conflicts.

Keep in mind that this method is only effective for enabling these features as they relate to your website users. If you want to enable these features as they relate to your app users, then you need to update your app-tracking code per the methods outlined for Android and iOS.

If you do not want to collect data for Advertising Features, be sure that both of these options are set to OFF, and that your tracking code is not configured to collect this data.

 

Modify your tracking code

Modifying your tracking code for a web property is not required to enable Remarketing and Advertising Reporting Features. The preferred method of enabling these features is to modify your property settings as described above.

You can modify your tracking code to enable Display Remarketing and the Advertising Reporting Features. If you want to enable Remarketing Lists for Search Ads, you need to use the property settings described above.

If you choose to enable Display Remarketing and the Advertising Reporting Features by updating your tracking code, you need to make only a simple, one-line change to your code as described in the following sections. This modification does not impact any customizations you have previously made to your code.

The changes you need to make to your web pages depend on which tracking code you’re using. See if you have Classic Analytics (ga.js) or Universal Analytics (analytics.js).

There can be circumstances where you have made these updates to the tracking code on only portions of your site, and then subsequently enabled these features via the property setting, which enables collection of the advertising cookies on all your pages. In these circumstances, if you want to disable collection of the advertising cookies for any of the pages you previously modified, you need to revert the tags to their original states.

The same holds true under circumstances where you have tagged your entire site to enable these features: to disable these features for an individual page, you need to revert to the original tracking code.

If your web property is using Universal Analytics (analytics.js), then you can enable these features for your entire site by updating your property settings, or for individual pages by modifying your tracking code.

If your web property is using Classic Google Analytics (ga.js), then you can enable these features only by modifying your tracking code.

Web-tracking code change for Universal Analytics (analytics.js)

To enable these features for Universal Analytics, insert the bold line into your existing tracking code between the 'create' and 'send' commands, as seen in this example:

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXX-XX', 'example.com');

ga('require', 'displayfeatures');
ga('send', 'pageview');
</script>
To revert the change, simply remove the line ga('require', 'displayfeatures');
Web-tracking code change for Classic Google Analytics (ga.js)

To enable these features for Classic Google Analytics, replace the bold text in this example:

Standard tracking code

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxx-y']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;


ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>

with the bold text in the example below:

Code modified to enable these features

<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxx-y']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;


ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
To revert the change, simply modify your tracking code to match the standard tracking code example in this section.

If you're using Google Tag Manager, follow these instructions to edit the Analytics tag.

 

Enable Remarketing and Advertising Reporting Features for an app

When you enable these features for an app, then Google Analytics collects the information it normally does, as well as anonymous information associated with mobile advertising IDs.

To enable these features for an app, you need to modify the Analytics tracking code that you have included in your app code. The examples below explain how to modify the tracking code for Android and iOS apps.

App-tracking code change for Android

To enable these features for Android, modify your Google Analytics tracking code to collect the advertising id. Call the enableAdvertisingIdCollection method on the tracker for which you want to enable these features. For example:

// Get tracker.
Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker(
TrackerName.APP_TRACKER);

// Enable Display Features.
t.enableAdvertisingIdCollection(true);

Learn more about supporting Display Advertising on Android

App-tracking code change for iOS

To enable these features for iOS, collect the IDFA (Identifier for Advertisers). To enable IDFA collection, link the libAdIdAccess.a and AdSupport.framework libraries to your application and set the allowIDFACollection to YES on each tracker that will collect the IDFA. For example:

// Assumes a tracker has already been initialized with a property ID, otherwise
// getDefaultTracker returns nil.
id tracker = [[GAI sharedInstance] defaultTracker];

// Enable IDFA collection.
tracker.allowIDFACollection = YES;

If you're using Google Tag Manager, follow these instructions to edit the Analytics tag.

 

Related resources

Google Tag Manager gives you the power to create and update tags for your website and mobile apps, any time you want. It gives marketers greater flexibility, and it lets webmasters relax and focus on other important tasks.

Was this article helpful?