Google Play Utilities

Advertising ID Retrieval

The advertising ID is a unique but user-resettable string identifier that lets ad networks and other apps anonymously identify a user. The user's advertising ID is made available to apps through APIs provided in Google Play services.

Users can reset their advertising ID at any time, right from the Ads section of the Google Settings app on their devices. From the same app, users can also opt out of targeted advertising based on the advertising ID by setting the appropriate ad tracking preference. When the user opts out of targeted ads, this ad tracking preference is made available to apps through a Google Play services API.

Apps making use of the advertising ID must check for and respect the user's ad tracking preference. Also, please, note that any use of the advertising ID must abide by the terms of the Google Play Developer Content Policies.

The Note From Google Documentation: As a reminder, please, note that starting from 1 August 2014 new apps and app updates distributed through Google Play must use the advertising ID in lieu of any other persistent identifiers for any advertising purposes  on devices that support the advertising ID. 

Format of the Advertising ID

Google Play services APIs expose the user's advertising ID as a string format of UUID, with values similar to this:



  • The advertising ID APIs are supported in Google Play services 4.0+
  • Support for the advertising ID on specific devices is based on their installed versions of Google Play services

Obtaining the user's advertising ID and ad tracking preference

The following code shows how to get Advertising Id using GooglePlayUtils class with GP_AdvertisingIdLoadResult result:

GooglePlayUtils.ActionAdvertisingIdLoaded += ActionAdvertisingIdLoaded;

private void ActionAdvertisingIdLoaded (GP_AdvertisingIdLoadResult res) {
	GooglePlayUtils.ActionAdvertisingIdLoaded -= ActionAdvertisingIdLoaded;

	if(res.IsSucceeded) {
		AndroidMessage.Create("Succeeded", "Advertising Id: " +;
	} else {
		AndroidMessage.Create("Failed", "Advertising Id failed to loaed");