Export (0) Print
Expand All

Target Devices and Operating Systems

Use device targeting to serve text ads only on specific device types and operating systems. By default, text ads will serve on all devices (for example, computers, smartphones, and tablets). To target specific devices and operating systems, use the UpdateDeviceOSTargets operation. You should use the Device element of the Target object only to remove all device targeting.

For example code, see C# | Java | PHP.

Creating a Device Target

If your ad group or campaign is already associated with a target object, follow these steps.

  1. Call the GetTargetsByAdGroupIds or GetTargetsByCampaignIds operation to get the target associated with the ad group or campaign.

  2. Create a DeviceOSTarget object and set the DeviceOSList element to a list of DeviceOS objects that identify the devices and operating systems to target. The list must contain unique combinations of devices and operating systems. To target all operating systems of a device, set the OSName element to null.

  3. Create a TargetAssociation object that associates the DeviceOSTarget object with the target you retrieved in step 1.

  4. Call the UpdateDeviceOSTargets operation to add the list of devices to the target.

If your ad group or campaign is not already associated with a target object, create a target object and add it to the target library before calling the UpdateDeviceOSTargets operation. (For information about creating a target and adding it to the customer’s target library, see Targeting.) When you create the Target object, set the Devices element of the DeviceTarget object to any device type (the type doesn’t matter because you will overwrite the devices when you call UpdateDeviceOSTargets).

Updating the List of Devices to Target

To update the list of devices and operating systems being targeted, follow these steps.

  1. Call the GetDeviceOSTargetsByIds operation to get the list of devices being targeted.

  2. Update the list as appropriate.

  3. Call the UpdateDeviceOSTargets operation to update the target with the updated list of devices. Because the operation overwrites the existing device list, you must specify all the devices that you want to target.

Deleting the List of Devices to Target

To delete the list of devices and operating systems being targeted, follow these steps.

  1. Call the GetTargetsByIds operation to get the target to update.

  2. Set the Device element of the Target object to null.

  3. Call the UpdateTargetsInLibrary operation to update the target and remove the devices.

Updating a Target Object that Targets Devices and Other Target Types

To update a Target object that targets devices and other target types, see Targeting. Because the UpdateTargetsInLibrary operation overwrites the existing target object, you must get the target object and update it as appropriate. Do not update the Device element of the target object unless you are setting it to null to remove all device targeting.

Community Additions

Show:
© 2014 Microsoft