Campaign
- Article
-
-
Contains the methods used to manage a campaign.
Methods
addLocation(int locationId)
Creates a location target in this campaign from a location ID.
Returns
Type |
Description |
TargetedLocationOperation |
The operation object used to check whether the targeted location was successfully added. |
addLocation(int locationId, double bidModifier)
Creates a location target in this campaign from a location ID and bid modifier.
Returns
Type |
Description |
TargetedLocationOperation |
The operation object used to check whether the targeted location was successfully added. |
addNegativeKeywordList(NegativeKeywordList negativeKeywordList)
Adds a negative keyword list to this campaign.
Arguments
Name |
Type |
Description |
negativeKeywordList |
NegativeKeywordList |
The negative keyword list to add to this campaign. A campaign may contain a maximum of 20 lists. |
Returns
Type |
Description |
void |
Returns nothing. |
adGroups
Gets a selector used to filter the list of ad groups in this campaign.
Returns
Type |
Description |
AdGroupSelector |
A selector used to filter the list of ad groups in this campaign. |
ads
Gets a selector used to filter the list of ads in this campaign.
Returns
Type |
Description |
AdSelector |
A selector used to filter the list of ads in this campaign. |
applyLabel(string name)
Applies the label to the campaign.
You may apply a maximum of 50 labels to a campaign. For an example that adds a label to an entity, see Using labels.
Arguments
Name |
Type |
Description |
name |
string |
The label's case-sensitive name. To get a list of labels in this account that you can apply, see AdsApp.labels. |
Returns
Type |
Description |
void |
Returns nothing. |
enable
Enables this campaign.
Returns
Type |
Description |
void |
Returns nothing. |
excludeLocation(int locationId)
Creates a location exclusion in this campaign from a location ID.
Returns
Type |
Description |
ExcludedLocationOperation |
The operation object used to check whether the excluded location was successfully added. |
getBiddingStrategyType
Gets this campaign's bidding strategy.
Returns
Type |
Description |
string |
The campaign's bidding strategy. Possible values are:
- MANUAL_CPC
- TARGET_SPEND
- MAXIMIZE_CONVERSIONS
- ENHANCED_CPC
- TARGET_CPA
For more information, see Bid Strategies. |
getBudget
Gets this campaign's budget.
Returns
Type |
Description |
Budget |
Contains the methods for managing this campaign's budget. |
getEntityType
Gets this entity's type.
Returns
Type |
Description |
string |
This entity's type, which is Campaign. |
getId
Gets the ID that uniquely identifies this campaign.
Returns
Type |
Description |
string |
The ID that uniquely identifies this campaign. |
getName
Gets this campaign's name.
Returns:
Type |
Description |
string |
The campaign's name. |
getStats
Gets this campaign's performance data.
To call this method, you must include one of the forDateRange
methods in the campaign selector's chain.
Returns
Type |
Description |
Stats |
The campaign's performance data. |
isEnabled
Gets a Boolean value that indicates whether this campaign is enabled.
Returns
Type |
Description |
boolean |
Is true if this campaign is enabled; otherwise, false. |
isPaused
Gets a Boolean value that indicates whether this campaign is paused.
Returns
Type |
Description |
Boolean |
Is true if this campaign is paused; otherwise, false. |
isRemoved
Gets a Boolean value that indicates whether this campaign is removed (deleted).
Returns
Type |
Description |
Boolean |
Is true if this campaign is removed; otherwise, false. |
keywords
Gets a selector used to filter the list of keywords in this campaign.
Returns
Type |
Description |
KeywordSelector |
A selector used to filter the list of keywords in this campaign. |
labels
Gets a selector used to filter the list of labels associated with this campaign.
Returns
Type |
Description |
LabelSelector |
A selector used to filter the list of labels associated with this campaign. |
newAdGroupBuilder
Gets a builder used to add an ad group to this campaign.
Returns
Type |
Description |
AdGroupBuilder |
The builder used to add an ad group to this campaign. |
pause
Pauses this campaign.
Returns
Type |
Description |
void |
Returns nothing. |
productGroups
Gets a selector used to filter the list of product groups in this campaign.
Returns
Type |
Description |
ProductGroupSelector |
A selector used to filter the list of product groups in this campaign. |
remove
Removes this campaign.
Returns
Type |
Description |
void |
Returns nothing. |
removeLabel(string name)
Removes the label from the campaign.
Arguments
Name |
Type |
Description |
name |
string |
The label's case-sensitive name. To get a list of labels associated with this campaign, see labels. |
Returns
Type |
Description |
void |
Returns nothing. |
setName(string name)
Sets the campaign's name.
Arguments
Name |
Type |
Description |
name |
string |
The campaign's name. The name may contain a maximum of 128 characters and must be unique within the account. |
Returns
Type |
Description |
void |
Returns nothing. |
targeting
Provides access to campaign level targeting criteria: location targeting.
Returns
Type |
Description |
CampaignTargeting |
Access to location targeting criteria in this campaign. |
urls
Gets the methods for managing this campaign's tracking template and custom parameters.
Returns
Type |
Description |
CampaignUrls |
Contains the methods for managing this campaign's tracking template and custom parameters. |
See also