This guides describes how to enable advertising features using the Google Analytics SDK v4 for Android.
Learn more about Google Analytics Advertising Features.
To enable advertising features requires a single addition to your
Google Analytics tracking code to collect the advertising id. Call the
enableAdvertisingIdCollection method on the tracker for which
you want to enable advertising features. For example:
// Get tracker. Tracker t = ((AnalyticsSampleApp) getActivity().getApplication()).getTracker( TrackerName.APP_TRACKER); // Enable Advertising Features. t.enableAdvertisingIdCollection(true);
The feature works by collecting the advertising identifier. Please make sure to review and adhere to all applicable SDK policies when using this feature.