AdsApp.DisplayKeywordBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for DisplayKeyword
objects. Example usage:
var
displayKeywordBuilder
=
adGroup
.
display
()
.
newKeywordBuilder
();
var
displayKeyword
=
displayKeywordBuilder
.
withText
(
"keyword text"
)
//
required
.
withCpc
(
0.50
)
//
optional
.
build
()
//
create
the
display
keyword
Methods:
build()
Builds the display keyword. Returns a DisplayKeywordOperation
that
corresponds to the creation of the DisplayKeyword
. Return values:
exclude()
Builds the excluded display keyword. Returns an ExcludedDisplayKeywordOperation
that corresponds to the creation of the ExcludedDisplayKeyword
. Return values:
withCpc(cpc)
Sets the max CPC bid of the new display keyword to the specified value. Arguments:
Return values:
withCpm(cpm)
Sets the CPM bid of the new display keyword to the specified value. See Cost-per-thousand
impressions (CPM)
for more information.
Arguments:
Return values:
withText(text)
Sets the text of the display keyword. This field is required. Arguments:
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\u003eThe DisplayKeywordBuilder facilitates the creation and management of display keywords within Google Ads scripts.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods like \u003ccode\u003ewithText\u003c/code\u003e, \u003ccode\u003ewithCpc\u003c/code\u003e, and \u003ccode\u003ewithCpm\u003c/code\u003e to define keyword attributes, with \u003ccode\u003ewithText\u003c/code\u003e being mandatory.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method finalizes the display keyword creation, while \u003ccode\u003eexclude()\u003c/code\u003e specifically builds excluded display keywords.\u003c/p\u003e\n"],["\u003cp\u003eBoth \u003ccode\u003ebuild()\u003c/code\u003e and \u003ccode\u003eexclude()\u003c/code\u003e return corresponding operation objects for the respective keyword types, such as \u003ccode\u003eDisplayKeywordOperation\u003c/code\u003e and \u003ccode\u003eExcludedDisplayKeywordOperation\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# AdsApp.DisplayKeywordBuilder\n\nBuilder for [DisplayKeyword](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeyword) objects.\n\nExample usage:\n\n```gdscript\nvar displayKeywordBuilder = adGroup.display().newKeywordBuilder();\nvar displayKeyword = displayKeywordBuilder\n .withText(\"keyword text\") // required\n .withCpc(0.50) // optional\n .build() // create the display keyword\n```\n\n### Methods:\n\n| Member | Type | Description |\n|----------------------------------|----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|\n| [build()](#build) | [AdsApp.DisplayKeywordOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordoperation) | Builds the display keyword. |\n| [exclude()](#exclude) | [AdsApp.ExcludedDisplayKeywordOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludeddisplaykeywordoperation) | Builds the excluded display keyword. |\n| [withCpc(cpc)](#withCpc_cpc) | [AdsApp.DisplayKeywordBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordbuilder) | Sets the max CPC bid of the new display keyword to the specified value. |\n| [withCpm(cpm)](#withCpm_cpm) | [AdsApp.DisplayKeywordBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordbuilder) | Sets the CPM bid of the new display keyword to the specified value. |\n| [withText(text)](#withText_text) | [AdsApp.DisplayKeywordBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordbuilder) | Sets the text of the display keyword. |\n\n`build()`\n---------\n\nBuilds the display keyword. Returns a [DisplayKeywordOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordoperation) that corresponds to the creation of the [DisplayKeyword](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeyword).\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------|------------------------------|\n| [AdsApp.DisplayKeywordOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordoperation) | The DisplayKeywordOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded display keyword. Returns an [ExcludedDisplayKeywordOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludeddisplaykeywordoperation) that corresponds to the creation of the [ExcludedDisplayKeyword](/google-ads/scripts/docs/reference/adsapp/adsapp_excludeddisplaykeyword).\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------|\n| [AdsApp.ExcludedDisplayKeywordOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludeddisplaykeywordoperation) | The ExcludedDisplayKeywordOperation. |\n\n`withCpc(cpc)`\n--------------\n\nSets the max CPC bid of the new display keyword to the specified value.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|-----------------------------------------|\n| cpc | `double` | The max CPC bid of the display keyword. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [AdsApp.DisplayKeywordBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordbuilder) | The display keyword builder with the specified max CPC. |\n\n`withCpm(cpm)`\n--------------\n\nSets the CPM bid of the new display keyword to the specified value.\n\nSee [Cost-per-thousand\nimpressions (CPM)](//support.google.com/google-ads/answer/6310) for more information.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|-------------------------------------|\n| cpm | `double` | The CPM bid of the display keyword. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|\n| [AdsApp.DisplayKeywordBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordbuilder) | The display keyword builder with the specified CPM. |\n\n`withText(text)`\n----------------\n\nSets the text of the display keyword. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|---------------------------|\n| text | `String` | The display keyword text. |\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| [AdsApp.DisplayKeywordBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_displaykeywordbuilder) | A DisplayKeywordBuilder with the specified text. |"]]