Here you go.
https://support.google.com/analytics/answer/2444872
For Android
To enable these features for Android, modify your 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);
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.
// 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;