Advertising​Manager Advertising​Manager Advertising​Manager Advertising​Manager Class

Definition

Provides a property that lets the caller retrieve the advertising ID.

public : static class AdvertisingManagerpublic static class AdvertisingManagerPublic Static Class AdvertisingManager// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

AdvertisingManager is a static runtime object and does not need to be retrieved or created.

Properties

AdvertisingId AdvertisingId AdvertisingId AdvertisingId

Retrieves a unique ID used to provide more relevant advertising. If the advertising ID feature is turned off, no ID is retrieved.

public : static PlatForm::String AdvertisingId { get; }public static string AdvertisingId { get; }Public Static ReadOnly Property AdvertisingId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

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

Remarks

This 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. It is also used 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 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. 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 retrieved as shown here:


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

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

auto advertisingId = Windows::System::UserProfile::AdvertisingManager::AdvertisingId;
See Also

Methods

GetForUser(User) GetForUser(User) GetForUser(User) GetForUser(User)

Gets the advertising ID for the specified user.

public : static AdvertisingManagerForUser GetForUser(User user)public static AdvertisingManagerForUser GetForUser(User user)Public Static Function GetForUser(user As User) As AdvertisingManagerForUser// You can use this method in JavaScript.
Parameters
user
User User User User

The user to get the advertising ID for.

Returns
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

See Also