You can target your ads to display to users of a certain age group, display on certain days of the week, or display to users in a particular geographical area. Targets are stored in a library and are tied to your customer identifier. After you add a target to the library, you can associate the target with one or more ad groups or campaigns.
The ad group or keyword bid is used as the base bid. When you define a target, you can choose to increases the base bid by a specified percentage. For example, if your business sells pet supplies on the Internet, but you also have a storefront in Seattle, you can set your base bid for the "pet supplies" keyword to $1, and create a location target for your campaign that increases the bid by 50% for users in the Seattle metropolitan area. If a user in Los Angeles searches for "pet supplies", your bid for that keyword will be the base bid of $1; however, if a user in Seattle searches for "pet supplies", your bid is increased by 50% to $1.50.
If you specify more than one target type, the ad will be displayed only if all conditions are met, except for targets that contain age and gender target types. The age and gender target types will not prevent ads from displaying to users who do not match the target condition. For more information, see the Remarks section of the Target data object.
For example, if you specify age, day, and hour target types, the ad will be displayed if today is in the list of days being targeted and the current time is in the list of hours being targeted. If the day and hour conditions are not met, the ad will not be displayed. If the hour and day conditions are met, the base bid is increased by the incremental bid percentage specified by the hour and day target types and by the age target type if the user is within one of the specified age ranges.
However, some target types, such as day and hour, provide a flag that you can set that determines whether the ad can be displayed to the user even if the condition is not met. For example, the day target type includes the TargetAllDays flag and the hour target type includes the TargetAllHours flag. If the flag is set, the ad can be displayed if the condition is not met, but the bid will not be increased by the specified incremental bid percentage. In the previous example, if you set the TargetAllDays flag to true, the ad will be displayed if the hour condition is met.
For details about managing your targets, see the following sections.
Add Targets
Get Targets
Update Targets
Delete Targets
Add Targets
To create a target that you can then associate with an ad group or campaign, complete the following steps.
Create an instance of the object that represents the desired target, and then assign it to the appropriate element of the Target object. For example, to target users of specific ages, create an instance of the AgeTarget object, specify the target age ranges and incremental bid percentages in the Bids element, and then set the Target.Age element to the AgeTarget object. The following target types are available.
To add the Target object to your target library, call the AddTargetsToLibrary operation. Preserve the target identifier that AddTargetsToLibrary returns.
To associate the target with an ad group, call the SetTargetToAdGroup operation, passing the ad group identifier and the target identifier.
To associate the target with a campaign, call the SetTargetToCampaign operation, passing the campaign identifier and the target identifier.
You can apply one target to an ad group or campaign. The SetTargetToAdGroup and SetTargetToCampaign operations throw an exception if the ad group or campaign already has a target association. You must remove the association first, as shown in Delete Targets.
If you specify targets at the ad group and campaign levels, the ad group-level targets will override the campaign-level targets.
For examples that show how to create targets, see:
Get Targets
You can get information about the targets that are in your library by using the GetTargetsInfoFromLibrary operation. This operation returns an array of TargetInfo objects for all targets in your library. The TargetInfo object contains only basic information, such as the identifier of the target.
To obtain more detailed information about one or more targets, use the GetTargetsByIds operation. This operation takes an array of target identifiers and returns the full set of information about the specified targets.
To get the targets that are associated with one or more ad groups, use the GetTargetsByAdGroupIds operation. Similarly, use the GetTargetsByCampaignIds operation to get the targets that are associated with one or more campaigns.
Update Targets
To update one or more targets, call the UpdateTargetsInLibrary operation. Because the update operation performs a complete overwrite of the existing target, you typically call the GetTargetsByIds operation to get the target, modify the target as appropriate, and then call UpdateTargetsInLibrary.
If you do not get the existing target object and instead pass a target object that contains only the target types being updated, the updated target will contain only the updated target types. For example, if the target contains the day and hour target types and you create a target object and specify only the hour target type with the updated hours, the target will contain only the hour target type after the update.
For an example that shows how to update a target, see Update Targets.
Delete Targets
To remove the target association for an ad group, call the DeleteTargetFromAdGroup operation. To remove the target association for a campaign, call the DeleteTargetFromCampaign operation. These operations remove only the association between the entity and the target. The target is still retained in the library even if there is no association.
To remove a target from your library, call the DeleteTargetsFromLibrary operation.