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:
Type | Description |
AdsApp.Campaign |
The base campaign to which this excluded location belongs. |
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:
Type | Description |
AdsApp.Campaign |
The campaign to which this excluded location belongs or null if it does
not belong to a search or display campaign. |
getCampaignType()
Returns the campaign type. Possible return values:
SEARCH_OR_DISPLAY, VIDEO, SHOPPING
Return values:
Type | Description |
String |
Video campaign type. |
getCountryCode()
Returns the country code of this location.
This is the standard two-letter country code, e.g. "US"
or "BR"
.
Return values:
Type | Description |
String |
The country code of this location. |
getEntityType()
Returns the type of this entity as a
String
, in this case,
"ExcludedLocation"
.
Return values:
Type | Description |
String |
Type of this entity: "ExcludedLocation" . |
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:
Type | Description |
long |
The ID of the excluded location. |
getName()
Returns the name of this location.
Return values:
Type | Description |
String |
The name of this location. |
Returns the shopping campaign to which this excluded location belongs or
null
if
it does not belong to a shopping campaign.
Return values:
Type | Description |
AdsApp.ShoppingCampaign |
The shopping campaign to which this excluded location belongs or null if
it does not belong to a shopping campaign. |
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 the AdWords API documentation on geotargeting.
Return values:
Type | Description |
String |
The target type of this location. |
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, please see the AdWords API documentation on
geotargeting.
"OBSOLETE"
: indicates that the location cannot be targeted.
Return values:
Type | Description |
String |
The targeting status of this location. |
getVideoCampaign()
Returns the video campaign to which this excluded location belongs or
null
if it
does not belong to a video campaign.
Return values:
Type | Description |
AdsApp.VideoCampaign |
The video campaign to which this excluded location belongs or null if it
does not belong to a video campaign. |
remove()
Removes the excluded location.
Returns nothing.