AdvertisingManager AdvertisingManager AdvertisingManager AdvertisingManager Class

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

Syntax

Declaration

public static class AdvertisingManagerpublic static class AdvertisingManagerPublic Static Class AdvertisingManager

Remarks

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

Properties summary

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

Methods summary

Gets the advertising ID for the specified user.

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 string AdvertisingId { get; }public static string AdvertisingId { get; }Public Static ReadOnly Property AdvertisingId As string

    Property Value

    • 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;
    

Methods

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute

Details

Assembly

Windows.System.UserProfile.dll