AdsApp.ExcludedLocation
Stay organized with collections
Save and categorize content based on your preferences.
Represents a Google Ads excluded location. Excluded locations are used to restrict your ads from showing in specific
geographic areas. For instance, a campaign could show ads in all parts of a
country except for a specific city by having a TargetedLocation
for the entire
country and an ExcludedLocation
for that specific city.
For more information on locations, see the API documentation on
geotargeting
.
See also TargetedLocation
.
Methods:
getBaseCampaign()
Returns the base campaign to which this excluded location belongs. Return values:
getCampaign()
Returns the campaign to which this excluded location belongs or null
if it does not belong to a search or display campaign. Return values:
getCampaignType()
Returns the campaign type. Possible return values: SEARCH_OR_DISPLAY, VIDEO, SHOPPING
Return values:
getCountryCode()
Returns the country code of this location. This is the standard two-letter country code, e.g. "US"
or "BR"
.
Return values:
getEntityType()
Returns the type of this entity as a String
, in this case, "ExcludedLocation"
. Return values:
getId()
Returns the ID of the excluded location. Location IDs are shared across campaigns. In order to uniquely identify
a location exclusion, one must specify both its campaign ID and the
location ID.
Return values:
getName()
Returns the name of this location. Return values:
getResourceName()
Returns the resource name of the excluded location. Return values:
Returns the shopping campaign to which this excluded location belongs or null
if it does not belong to a shopping campaign. Return values:
getTargetType()
Returns the target type of this location. The target type is a generic description of the location, such as "City"
, "Postal Code"
, or "Country"
.
For a full list of target types, see Geo targets
.
Return values:
getTargetingStatus()
Returns the targeting status of this location. This can return one of three values:
-
"ACTIVE"
: indicates that the location can be targeted as
normal. The vast majority of locations are active.
-
"PHASING_OUT"
: indicates that the location can be
targeted, but that support will soon be removed. To get a list of
which locations are phasing out, see Geo targets
.
-
"OBSOLETE"
: indicates that the location cannot be
targeted.
Return values:
getVideoCampaign()
Returns the video campaign to which this excluded location belongs or null
if it does not belong to a video campaign. Return values:
remove()
Removes the excluded location. Returns nothing.
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 an excluded location in Google Ads, used to prevent ads from showing in specific geographic areas.\u003c/p\u003e\n"],["\u003cp\u003eCan be used to exclude locations from various campaign types, such as Search, Display, Shopping, and Video campaigns.\u003c/p\u003e\n"],["\u003cp\u003eProvides methods to access information about the excluded location, like its ID, name, country code, and targeting status.\u003c/p\u003e\n"],["\u003cp\u003eAllows retrieval of the campaign to which the excluded location belongs, or \u003ccode\u003enull\u003c/code\u003e if it doesn't belong to a specific campaign type.\u003c/p\u003e\n"],["\u003cp\u003eOffers a \u003ccode\u003eremove()\u003c/code\u003e method to delete the excluded location from the campaign.\u003c/p\u003e\n"]]],[],null,[]]