AdsApp.Keyword
Stay organized with collections
Save and categorize content based on your preferences.
Represents a Google Ads keyword. Methods:
adParams()
Creates a selector of all ad params belonging to this keyword. Return values:
applyLabel(name)
Applies a label to the keyword. name
of the label
is case-sensitive. Operation will fail if the label with the specified name
does not already exist in the account. Note that the keyword cannot have more than 50 labels.
Returns nothing.
Arguments:
bidding()
Provides access to this keyword's bidding fields. Return values:
clearDestinationUrl()
Clears the destination URL of the keyword. To upgrade keywords to final
URL, first clear the destination URL, then set the final URL with KeywordUrls.setFinalUrl
. Returns nothing.
enable()
Enables the keyword. Returns nothing.
getAdGroup()
Returns the ad group to which this keyword belongs. Return values:
getApprovalStatus()
Returns the approval status of the keyword. Possible values: APPROVED, PENDING_REVIEW, UNDER_REVIEW, DISAPPROVED
. Return values:
getBaseAdGroup()
Returns the base ad group to which this keyword belongs. Return values:
getBaseCampaign()
Returns the base campaign to which this keyword belongs. Return values:
getCampaign()
Returns the campaign to which this keyword belongs or null
if it does not belong to a search or display campaign. Return values:
getEntityType()
Returns the type of this entity as a String
, in this case, "Keyword"
. Return values:
getFirstPageCpc()
Returns the first page cpc for the keyword. Return values:
getId()
Returns the ID of the keyword. Keyword IDs may be shared across ad groups. In order to uniquely
identify one keyword, one must specify both its ad group ID and the keyword
ID.
Return values:
getMatchType()
Returns the match type of the keyword. Possible values: BROAD,
PHRASE, EXACT
. Return values:
getQualityScore()
Returns the quality score of the keyword, in 1..10
range. Note:
Starting the week of September 12, 2016, this method will
return a NULL
instead of a number for keywords that don't have
enough impressions or metrics.clicks to determine a quality score.
Return values:
getResourceName()
Returns the resource name of the keyword.
A keyword can be identified by an ad_group_criterion resource name or a
keyword_view resource name. This method will return an ad_group_criterion
resource name although either is compatible with KeywordSelector.withResourceNames
. Return values:
getStatsFor(dateRange)
Returns stats for the specified date range. Supported values: TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK,
LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT,
THIS_MONTH, LAST_MONTH, ALL_TIME
.
Example:
var
stats
=
keyword
.
getStatsFor
(
"THIS_MONTH"
);
Arguments:
Return values:
getStatsFor(dateFrom, dateTo)
Returns stats for the specified custom date range. Both parameters can be
either an object containing year, month, and day fields, or an 8-digit
string in YYYYMMDD
form. For instance, March 24th,
2013
is represented as either {year: 2013, month: 3, day:
24}
or "20130324"
. The date range is inclusive on both
ends, so forDateRange("20130324", "20130324")
defines a range
of a single day. Arguments:
Return values:
getText()
Returns the text of the keyword. The returned value will be formatted as
follows, depending on the match type: -
shoes
- broad match
-
"shoes"
- phrase match
-
[leather shoes]
- exact match
Return values:
getTopOfPageCpc()
Returns the top of page cpc for the keyword. Return values:
isEnabled()
Returns true
if the keyword is enabled. Return values:
isPaused()
Returns true
if the keyword is paused. Return values:
labels()
Creates a selector of all labels applied to the keyword. Return values:
pause()
Pauses the keyword. Returns nothing.
remove()
Removes the keyword. Returns nothing.
removeLabel(name)
Removes a label from the keyword. name
of the
label is case-sensitive. Operation will fail if the label with the
specified name does not already exist in the account. Returns nothing.
Arguments:
setAdParam(index, insertionText)
Creates an ad param for this keyword with the specified index and insertion
text. Returns nothing.
Arguments:
setAdParam(index, insertionText)
Creates an ad param for this keyword with the specified index and insertion
text. Returns nothing.
Arguments:
urls()
Provides access to this keyword's URL fields. See Using Upgraded
URLs
for more information. Return values:
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 keyword within Google Ads, offering various methods for management and analysis.\u003c/p\u003e\n"],["\u003cp\u003eEnables control over keyword settings like bidding, labels, and URLs, along with activation and pausing.\u003c/p\u003e\n"],["\u003cp\u003eProvides access to performance data through stat retrieval for specific date ranges.\u003c/p\u003e\n"],["\u003cp\u003eAllows retrieval of keyword attributes such as ID, match type, quality score, and approval status.\u003c/p\u003e\n"],["\u003cp\u003eFacilitates ad param creation and management, enabling dynamic insertion of values into ad text.\u003c/p\u003e\n"]]],[],null,[]]