AdsApp

This is the top-level object used to access and manage a single account.

Note

This object replaces the BingAdsApp object. For the immediate future, Scripts will continue to support BingAdsApp for backwards compatibility; however, you're encouraged to update your scripts to use this object at your earliest convenience.

Methods

Method Name Return Type Description
adGroups AdGroupSelector Gets a selector used to filter the list of ad groups in this account.
ads AdSelector Gets a selector used to filter the list of ads in this account.
budgets BudgetSelector Gets a selector used to filter the list of shared budgets in this account.
campaigns CampaignSelector Gets a selector used to filter the list of campaigns in this account.
createLabel(string name, string description, string backgroundColor) void Creates a label.
currentAccount Account Gets the account that the script is currently processing.
getExecutionInfo ExecutionInfo Returns information about the environment in which the script is currently executing.
keywords KeywordSelector Gets a selector used to filter the list of keywords in this account.
labels LabelSelector Gets a selector used to filter the list of labels in this account.
negativeKeywordLists NegativeKeywordListSelector Gets a selector used to filter the list of negative keyword lists in this account.
newNegativeKeywordListBuilder NegativeKeywordListBuilder Gets a builder used to add a negative keyword list to this account.
productGroups ProductGroupSelector Gets a selector used to filter the list of product groups in this account.
shoppingAdGroups AdGroupSelector Gets a selector used to filter the list of ad groups used for shopping in this account.
shoppingCampaigns CampaignSelector Gets a selector used to filter the list of campaigns used for shopping in this account.
userLists UserListSelector Gets a selector used to filter the list of user lists in this account.

adGroups

Gets a selector used to filter the list of ad groups in this account.

Returns

Type Description
AdGroupSelector A selector used to filter the list of ad groups in the current account.

ads

Gets a selector used to filter the list of ads in this account.

Returns

Type Description
AdSelector A selector used to filter the list of ads in the current account.

budgets

Gets a selector used to filter the list of shared budgets in this account.

This method returns only shared budgets. To get unshared (individual campaign) budgets, call the specific campaign's getBudget method. The campaign's budget is not shared if the isExplicitlyShared method returns false.

Returns

Type Description
BudgetSelector A selector used to filter the list of shared budgets in the current account.

campaigns

Gets a selector used to filter the list of campaigns in this account.

Returns

Type Description
CampaignSelector A selector used to filter the list of campaigns in the current account.

createLabel(string name, string description, string backgroundColor)

Creates a label.

For limits on the number of labels you may create per account, see Limits. For an example that adds a label to an account, see Using labels.

Arguments

Name Type Description
backgroundColor string Optional. The background color to use in the UX for the label. You may specify the color using:
  • A three-byte hexadecimal number in the form, #RRGGBB. For example, #CB0400.
  • One of the 16 known CSS color names. For example, aqua, yellow, and fuchsia.
Consider accessability when choosing the color. If not specified, a random color is chosen for you.
description string Optional. A description that describes the label's use. The maximum size is 200 characters.

If you specify backgroundColor, you must provide a description or an empty string ("").
name string Required. The label's name. The name is case sensitive and must be unique within the account. The maximum size is 80 characters. The method trims leading and trailing whitespace from the name.

Returns

Type Description
void Returns nothing.

currentAccount

Gets the account that the script is currently processing.

Note

To use this method in a multi-account scenario, first select an account to manage. If you call this method before selecting an account, the call returns null.

Returns

Type Description
Account The account that the script is currently processing. To see how to use this in a multi-account scenario, see the select method of AccountsApp.

getExecutionInfo

Returns information about the environment in which the script is currently executing.

Returns:

Type Description
ExecutionInfo Information about the environment in which the script is currently executing.

keywords

Gets a selector used to filter the list of keywords in this account.

Returns

Type Description
KeywordSelector A selector used to filter the list of keywords in the current account.

labels

Gets a selector used to filter the list of labels in this account.

Returns

Type Description
LabelSelector A selector used to filter the list of labels in the current account.

negativeKeywordLists

Gets a selector used to filter the list of negative keyword lists in this account.

Returns

Type Description
NegativeKeywordListSelector A selector used to filter the list of negative keyword lists in the current account.

newNegativeKeywordListBuilder

Gets a builder used to add a negative keyword list to this account.

Returns

Type Description
NegativeKeywordListBuilder A builder used to add a negative keyword list to the current account.

productGroups

Gets a selector used to filter the list of product groups in this account.

Returns

Type Description
ProductGroupSelector A selector used to filter the list of product groups in the current account.

shoppingAdGroups

Gets a selector used to filter the list of ad groups used for shopping in this account.

Returns

Type Description
AdGroupSelector A selector used to filter the list of ad groups used for shopping in the current account.

shoppingCampaigns

Gets a selector used to filter the list of campaigns used for shopping in this account.

Returns

Type Description
CampaignSelector A selector used to filter the list of campaigns used for shopping in the current account.

userLists

Gets a selector used to filter the list of user lists in this account.

Returns

Type Description
UserListSelector A selector used to filter the list of user lists in the current account.

See also

Single account access