AdsApp.PlacementBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for
Placement objects.
Example usage:
var placementBuilder = adGroup.display().newPlacementBuilder()
.withUrl("http://www.site.com") // required
.withCpc(0.50) // optional
.build() // create the placement
Methods:
build()
Builds the placement. Returns a
PlacementOperation that
corresponds to the creation of the
Placement.
Return values:
exclude()
Builds the excluded placement. Returns an
ExcludedPlacementOperation
that corresponds to the creation of the
ExcludedPlacement.
Return values:
withCpc(cpc)
Sets the max CPC bid of the new placement to the specified value.
Arguments:
Name | Type | Description |
cpc |
double |
The max CPC bid of the placement. |
Return values:
withCpm(cpm)
Sets the CPM bid of the new placement to the specified value.
See Cost-per-thousand
impressions (CPM) for more information.
Arguments:
Name | Type | Description |
cpm |
double |
The CPM bid of the placement. |
Return values:
withUrl(url)
Sets the URL of the placement. This field is required.
Arguments:
Name | Type | Description |
url |
String |
The placement URL. |
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-08-25 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-08-25 UTC."],[[["\u003cp\u003eThe PlacementBuilder is used to create or exclude placements for display campaigns.\u003c/p\u003e\n"],["\u003cp\u003eIt requires a URL and allows optional CPC or CPM bids to be set.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e creates a Placement, while \u003ccode\u003eexclude()\u003c/code\u003e creates an ExcludedPlacement.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ewithCpc()\u003c/code\u003e, \u003ccode\u003ewithCpm()\u003c/code\u003e, and \u003ccode\u003ewithUrl()\u003c/code\u003e methods are used to configure the placement.\u003c/p\u003e\n"]]],[],null,["# AdsApp.PlacementBuilder\n\nBuilder for [Placement](/google-ads/scripts/docs/reference/adsapp/adsapp_placement) objects.\n\nExample usage:\n\n```gdscript\nvar placementBuilder = adGroup.display().newPlacementBuilder()\n .withUrl(\"http://www.site.com\") // required\n .withCpc(0.50) // optional\n .build() // create the placement\n```\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|\n| [build()](#build) | [AdsApp.PlacementOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_placementoperation) | Builds the placement. |\n| [exclude()](#exclude) | [AdsApp.ExcludedPlacementOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedplacementoperation) | Builds the excluded placement. |\n| [withCpc(cpc)](#withCpc_cpc) | [AdsApp.PlacementBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_placementbuilder) | Sets the max CPC bid of the new placement to the specified value. |\n| [withCpm(cpm)](#withCpm_cpm) | [AdsApp.PlacementBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_placementbuilder) | Sets the CPM bid of the new placement to the specified value. |\n| [withUrl(url)](#withUrl_url) | [AdsApp.PlacementBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_placementbuilder) | Sets the URL of the placement. |\n\n`build()`\n---------\n\nBuilds the placement. Returns a [PlacementOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_placementoperation) that corresponds to the creation of the [Placement](/google-ads/scripts/docs/reference/adsapp/adsapp_placement).\n\n### Return values:\n\n| Type | Description |\n|--------------------------------------------------------------------------------------------------|-------------------------|\n| [AdsApp.PlacementOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_placementoperation) | The PlacementOperation. |\n\n`exclude()`\n-----------\n\nBuilds the excluded placement. Returns an [ExcludedPlacementOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedplacementoperation) that corresponds to the creation of the [ExcludedPlacement](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedplacement).\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------------|---------------------------------|\n| [AdsApp.ExcludedPlacementOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_excludedplacementoperation) | The ExcludedPlacementOperation. |\n\n`withCpc(cpc)`\n--------------\n\nSets the max CPC bid of the new placement to the specified value.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|-----------------------------------|\n| cpc | `double` | The max CPC bid of the placement. |\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [AdsApp.PlacementBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_placementbuilder) | The placement builder with the specified max CPC. |\n\n`withCpm(cpm)`\n--------------\n\nSets the CPM bid of the new placement 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 placement. |\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------|-----------------------------------------------|\n| [AdsApp.PlacementBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_placementbuilder) | The placement builder with the specified CPM. |\n\n`withUrl(url)`\n--------------\n\nSets the URL of the placement. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|--------------------|\n| url | `String` | The placement URL. |\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------|--------------------------------------------|\n| [AdsApp.PlacementBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_placementbuilder) | A PlacementBuilder with the specified URL. |"]]