Display Features

This can be used to enable display Advertising Features in Google Analytics, such as Remarketing, Demographics and Interest Reporting, and more. Previously this was added by calling a different JavaScript file. However in Universal Analytics you can now add it via the require command.

In analytics.js, you need to include the following line of code after your create call, but before any send events.
analytics.js
ga('require', 'displayfeatures');

Below is an example of where you should include it:

analytics.js
ga('create', 'UA-XXXXX-Y');
ga('require', 'displayfeatures');
ga('send', 'pageview');

Changing the Cookie Name

The default cookie name is _dc. You can change this by setting the cookieName option when you require the plugin.

analytics.js
ga('require', 'displayfeatures', undefined, {
    cookieName: 'display_features_cookie'
});

Using Multiple Trackers

To use the display features plugin with multiple trackers, prepend the require call with the tracker name.

analytics.js
//Create a tracker named 'foo' for property UA-XXXXX-Y
ga('create', 'UA-XXXXX-Y', {name: 'foo'});
ga('foo.require', 'displayfeatures');
ga('foo.send', 'pageview');

//Create a second tracker named 'bar' for a different property UA-XXXXX-Z
ga('create', 'UA-XXXXX-Z', {name: 'bar'});
ga('bar.require', 'displayfeatures');
ga('bar.send', 'pageview');