Advertising ID (Ad ID)
The ad id is a user-specific, unique, re-settable ad id, provided by the Google Play Service, which gives users better control for developers to provide a simple, standard system to continue using your application for The anonymous identifier for the purpose of the ad and either reset the tag or exit the benefit-based Google Play medical program.
The ad ID can be implemented in your application through a simple API.
Focus on development functions
Standard and Simple - Advertising logo is a standard part for analysis of advertising and simple systems .
Let the user control - the user can set their ID at any time or exit those interest-based ads from Google's app, and their preferences apply to the advertising agency's advertising ID.
Get the Google Play Service SDK - download the google-play-service.jar from the downloaded Android SDK's Extras directory
Read the documentation and examples - document examples
As a reminder , please note that from 2014-08-01 , the new application and application updates via Google activity must be used in any ad identifier for any advertising purposes instead of using ads on the ad ID device
How to check your application's compliance through the development console, or in the details of the relevant development policy changes, see the Google Game Developer Help Center Advertising ID Reference
Use the ad ID
The ad ID is a unique but user-reset string identifier that allows online advertising and other applications to anonymously identify a user. The user's advertising ID is provided through the API for the service provided to the application in the Google Play Service.
Users can set their advertising ID at any time from Google to set the application's right on the device's advertising section. From the same application, the user can also select targeted ad IDs based on the ad to set the appropriate ad tracking preferences. When a user selects a targeted ad , this ad tracking preference is provided to the application via the Google Play Service API .
App use ads must respect and respect user habits and preferences tracking, and note that any application that uses ad ids must respect Google's development content policy terms.
The Google Play Service API exposes and the user ID is the UUID string format.
The Ads ID API supports Google Play Service 4.0+ devices
Support for specific devices is based on the version of Google Paly Service that the device installs
The user's ad ID and ad tracking are given priority
If your app wants to use an ad ID, your device must have Google Play Service installed
The API for the ad ID is available in the com.google.android.gms.ads.identifier package in the Google Play Service library. Get the user's ad ID and tracking preferences , call the method getadvertisingidinfo () , which returns an advertisingidclient information package . User current ad ID and tracking preferences .
Getadvertisingidinfo () method of blocking calls, so you can not say it in the main thread (UI thread). If the main thread , the method throws an exceptionstateexception exception .
Once you retrieve the advertisingidclient object , you can use its getid () and islimitadtrackingenabled () methods to access the ad ID and ad tracking preferences .
| ||Retrieves the advertising ID.|
| ||Retrieve whether the user has limit ad tracking enabled or not.|