AdsApp.​ExcludedLocation

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:

MemberTypeDescription
getBaseCampaign AdsApp.Campaign Returns the base campaign to which this excluded location belongs.
getCampaign AdsApp.Campaign Returns the campaign to which this excluded location belongs or null if it does not belong to a search or display campaign.
getCampaignType String Returns the campaign type.
getCountryCode String Returns the country code of this location.
getEntityType String Returns the type of this entity as a String, in this case, "ExcludedLocation".
getId String Returns the ID of the excluded location.
getName String Returns the name of this location.
getResourceName String Returns the resource name of the excluded location.
getShoppingCampaign AdsApp.ShoppingCampaign Returns the shopping campaign to which this excluded location belongs or null if it does not belong to a shopping campaign.
getTargetType String Returns the target type of this location.
getTargetingStatus String Returns the targeting status of this location.
getVideoCampaign AdsApp.VideoCampaign Returns the video campaign to which this excluded location belongs or null if it does not belong to a video campaign.
remove void Removes the excluded location.

getBaseCampaign()

Returns the base campaign to which this excluded location belongs.

Return values:

TypeDescription
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:

TypeDescription
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:

TypeDescription
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:

TypeDescription
String The country code of this location.

getEntityType()

Returns the type of this entity as a String, in this case, "ExcludedLocation".

Return values:

TypeDescription
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:

TypeDescription
String The ID of the excluded location.

getName()

Returns the name of this location.

Return values:

TypeDescription
String The name of this location.

getResourceName()

Returns the resource name of the excluded location.

Return values:

TypeDescription
String The resource name of the excluded location.

getShoppingCampaign()

Returns the shopping campaign to which this excluded location belongs or null if it does not belong to a shopping campaign.

Return values:

TypeDescription
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 Geo targets.

Return values:

TypeDescription
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, see Geo targets.
  • "OBSOLETE": indicates that the location cannot be targeted.

Return values:

TypeDescription
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:

TypeDescription
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.