AdvertisingId | advertisingId property
Collapse the table of content
Expand the table of content

AdvertisingManager.AdvertisingId | advertisingId property

Retrieves a unique ID used to provide more relevant advertising by understanding which apps are used by the user and how they are used, and to improve quality of service by determining the frequency and effectiveness of ads and to detect fraud and security issues. This ID is per-user, per-device; all of the apps for a single user on a device have the same advertising ID. If the advertising ID feature is turned off, no ID is retrieved.


public static string AdvertisingId { get; }

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The advertising ID is represented as an alphanumeric string. When the advertising ID feature is turned off, this is an empty string.


The advertising ID feature is turned on if the user chooses express settings when installing Windows. The feature can be turned off by the user, either during the custom setup process when installing Windows or at any time later through the Privacy page of PC Settings. It can also be turned off through group policy.

Note  If the advertising ID feature is turned off by the user during the new device customization process, the feature will be turned off by default for any user account added to the device later. If they want to use the advertising ID, those users will have to explicitly turn the feature on through PC Settings.

When the feature is turned off and then on again, Windows creates a new advertising ID—the old one is not reused. The advertising ID can also be reset during operating system upgrades. Because the advertising ID is a per-device value, it is does not roam with the user account. It cannot be turned on for child accounts. The value is not backed up.

This property is called as shown here:

var advertisingId = Windows.System.UserProfile.AdvertisingManager.AdvertisingId;

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::System::UserProfile [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::System::UserProfile [C++]



See also

Microsoft Advertising SDK
Windows 8.1 app certification requirements for ads



© 2016 Microsoft