Label

Contains the methods for managing a label. For information about labels, see Labels.

Methods

Method Name Return Type Description
ads AdSelector Gets a selector used to filter the list of ads associated with this label.
adGroups AdGroupSelector Gets a selector used to filter the list of ad groups associated with this label.
campaigns CampaignSelector Gets a selector used to filter the list of campaigns associated with this label.
getColor string Gets the background color that's used in the UX for this label.
getDescription string Gets the label's description.
getEntityType string Gets this entity's type.
getId string Gets the ID that uniquely identifies this label.
getName string Gets the label's name.
keywords KeywordSelector Gets a selector used to filter the list of keywords associated with this label.
remove void Removes this label.
setColor(string color) void Sets the background color to use in the UX for this label.
setDescription(string description) void Sets the label's description.
setName(string name) void Sets label's name.

ads

Gets a selector used to filter the list of ads associated with this label.

Returns

Type Description
AdSelector A selector used to filter the list of ads associated with this label.

adGroups

Gets a selector used to filter the list of ad groups associated with this label.

Returns

Type Description
AdGroupSelector A selector used to filter the list of ad groups associated with this label.

campaigns

Gets a selector used to filter the list of campaigns associated with this label.

Returns

Type Description
CampaignSelector A selector used to filter the list of campaigns associated with this label.

getColor

Gets the background color that's used in the UX for this label.

Returns

Type Description
string The background color that's used in the UX for this label. The color is always returned in the form, #RRGGBB. For example, if you set color to red, this method returns #FF0000.

getDescription

Gets the label's description.

Returns

Type Description
string The label's description.

getName

Gets the label's name.

Returns

Type Description
string The label's name.

getEntityType

Returns this entity's type.

Returns

Type Description
string This entity's type, which is Label.

getId

Gets the ID that uniquely identifies this label.

Returns

Type Description
string The ID that uniquely identifies this label.

keywords

Gets a selector used to filter the list of keywords associated with this label.

Returns

Type Description
KeywordSelector A selector used to filter the list of keywords associated with this label.

remove

Removes this label.

Returns

Type Description
void Returns nothing.

setColor(string color)

Sets the background color to use in the UX for this label.

Arguments

Name Type Description
color The background color to use in the UX for this 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.

Returns

Type Description
void Returns nothing.

setDescription(string description)

Sets the label's description.

Arguments

Name Type Description
description A description that describes the label's use. The maximum size is 200 characters. To remove a description, use an empty string ("").

Returns

Type Description
void Returns nothing.

setName(string name)

Sets the label's name.

Arguments

Name Type Description
name The label's new 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. To get a list of label names already used in this account, see AdsApp.labels.

Returns

Type Description
void Returns nothing.

See also