AdsApp.Label
Stay organized with collections
Save and categorize content based on your preferences.
Represents a Google Ads label.
Methods:
adGroups()
Returns the selector of all ad groups to which the label is applied.
Return values:
ads()
Returns the selector of all ads to which the label is applied.
Return values:
Type | Description |
AdsApp.AdSelector |
The selector of all ads to which the label is applied. |
campaigns()
Returns the selector of all search and display campaigns to which the label
is applied.
Return values:
Type | Description |
AdsApp.CampaignSelector |
The selector of all search and display campaigns to which the label
is applied. |
getColor()
Returns the color code of the label.
Return values:
Type | Description |
String |
Color code of the label. The returned string will always be in
uppercase #RRGGBB , e.g., #FFAAFF but never
#ffaaff or #FAF . form. |
getDescription()
Returns the description of the label.
Return values:
Type | Description |
String |
Description of the label. |
getEntityType()
Returns the type of this entity as a
String
, in this case,
"Label"
.
Return values:
Type | Description |
String |
Type of this entity: "Label" . |
getId()
Returns the ID of the label.
Return values:
Type | Description |
String |
The ID of the label. |
getName()
Returns the name of the label.
Return values:
Type | Description |
String |
Name of the label. |
getResourceName()
Returns the resource name of the label.
Return values:
Type | Description |
String |
The resource name of the label. |
keywords()
Returns the selector of all keywords to which the label is applied.
Return values:
remove()
Removes the label.
Returns nothing.
setColor(color)
Sets the background color of the label.
Returns nothing.
Arguments:
Name | Type | Description |
color |
String |
The new color. It must be specified in either RGB form
(#RRGGBB or #RGB ) or one of the 16 basic CSS color
names. |
setDescription(description)
Sets the description for this label. The description may not be longer than
200 characters.
Returns nothing.
Arguments:
Name | Type | Description |
description |
String |
The description for the label. |
setName(name)
Changes the name of the Label. The name must be unique, non-empty, and may
not be longer than 100 characters. Any leading or trailing white spaces
will be trimmed.
Returns nothing.
Arguments:
Name | Type | Description |
name |
String |
The new name. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eRepresents a Google Ads label and provides methods to manage it.\u003c/p\u003e\n"],["\u003cp\u003eAllows you to get selectors for ad groups, ads, campaigns, and keywords associated with the label.\u003c/p\u003e\n"],["\u003cp\u003eEnables retrieval and modification of label properties like color, description, and name.\u003c/p\u003e\n"],["\u003cp\u003eIncludes methods to remove the label and update its attributes.\u003c/p\u003e\n"]]],[],null,["# AdsApp.Label\n\nRepresents a Google Ads label.\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|\n| [adGroups()](#adGroups) | [AdsApp.AdGroupSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupselector) | Returns the selector of all ad groups to which the label is applied. |\n| [ads()](#ads) | [AdsApp.AdSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_adselector) | Returns the selector of all ads to which the label is applied. |\n| [campaigns()](#campaigns) | [AdsApp.CampaignSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_campaignselector) | Returns the selector of all search and display campaigns to which the label is applied. |\n| [getColor()](#getColor) | `String` | Returns the color code of the label. |\n| [getDescription()](#getDescription) | `String` | Returns the description of the label. |\n| [getEntityType()](#getEntityType) | `String` | Returns the type of this entity as a `String`, in this case, `\"Label\"`. |\n| [getId()](#getId) | `String` | Returns the ID of the label. |\n| [getName()](#getName) | `String` | Returns the name of the label. |\n| [getResourceName()](#getResourceName) | `String` | Returns the resource name of the label. |\n| [keywords()](#keywords) | [AdsApp.KeywordSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_keywordselector) | Returns the selector of all keywords to which the label is applied. |\n| [remove()](#remove) | `void` | Removes the label. |\n| [setColor(color)](#setColor_color) | `void` | Sets the background color of the label. |\n| [setDescription(description)](#setDescription_description) | `void` | Sets the description for this label. |\n| [setName(name)](#setName_name) | `void` | Changes the name of the Label. |\n\n`adGroups()`\n------------\n\nReturns the selector of all ad groups to which the label is applied.\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|--------------------------------------------------------------|\n| [AdsApp.AdGroupSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupselector) | The selector of all ad groups to which the label is applied. |\n\n`ads()`\n-------\n\nReturns the selector of all ads to which the label is applied.\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------|--------------------------------------------------------|\n| [AdsApp.AdSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_adselector) | The selector of all ads to which the label is applied. |\n\n`campaigns()`\n-------------\n\nReturns the selector of all search and display campaigns to which the label is applied.\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [AdsApp.CampaignSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_campaignselector) | The selector of all search and display campaigns to which the label is applied. |\n\n`getColor()`\n------------\n\nReturns the color code of the label.\n\n### Return values:\n\n| Type | Description |\n|----------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `String` | Color code of the label. The returned string will always be in uppercase `#RRGGBB`, e.g., `#FFAAFF` but never `#ffaaff` or `#FAF`. form. |\n\n`getDescription()`\n------------------\n\nReturns the description of the label.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------|\n| `String` | Description of the label. |\n\n`getEntityType()`\n-----------------\n\nReturns the type of this entity as a `String`, in this case, `\"Label\"`.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------------|\n| `String` | Type of this entity: `\"Label\"`. |\n\n`getId()`\n---------\n\nReturns the ID of the label.\n\n### Return values:\n\n| Type | Description |\n|----------|----------------------|\n| `String` | The ID of the label. |\n\n`getName()`\n-----------\n\nReturns the name of the label.\n\n### Return values:\n\n| Type | Description |\n|----------|--------------------|\n| `String` | Name of the label. |\n\n`getResourceName()`\n-------------------\n\nReturns the resource name of the label.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------------|\n| `String` | The resource name of the label. |\n\n`keywords()`\n------------\n\nReturns the selector of all keywords to which the label is applied.\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------|-------------------------------------------------------------|\n| [AdsApp.KeywordSelector](/google-ads/scripts/docs/reference/adsapp/adsapp_keywordselector) | The selector of all keywords to which the label is applied. |\n\n`remove()`\n----------\n\nRemoves the label.\n\nReturns nothing.\n\n`setColor(color)`\n-----------------\n\nSets the background color of the label.\n\nReturns nothing.\n\n### Arguments:\n\n| Name | Type | Description |\n|-------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| color | `String` | The new color. It must be specified in either RGB form (`#RRGGBB` or `#RGB`) or one of the [16 basic CSS color names](http://www.w3.org/TR/css3-color/#html4). |\n\n`setDescription(description)`\n-----------------------------\n\nSets the description for this label. The description may not be longer than 200 characters.\n\nReturns nothing.\n\n### Arguments:\n\n| Name | Type | Description |\n|-------------|----------|--------------------------------|\n| description | `String` | The description for the label. |\n\n`setName(name)`\n---------------\n\nChanges the name of the Label. The name must be unique, non-empty, and may not be longer than 100 characters. Any leading or trailing white spaces will be trimmed.\n\nReturns nothing.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|---------------|\n| name | `String` | The new name. |"]]