AdsApp.​TargetedLocation

Represents a Google Ads targeted location.

Targeted locations are used to only show your ads in specific geographic areas. For instance, a broadly-targeted campaign might have location targets for an entire country, whereas a more specifically-targeted campaign might break down its location targets at the city level.

For more information on locations, see the API documentation on geotargeting.

See also ExcludedLocation.

Methods:

MemberTypeDescription
getBidModifierdoubleReturns the bid modifier for this targeted location.
getCampaignAdsApp.CampaignReturns the campaign to which this targeted location belongs or null if it does not belong to a search or display campaign.
getCampaignTypeStringReturns the campaign type.
getCountryCodeStringReturns the country code of this location.
getEntityTypeStringReturns the type of this entity as a String, in this case, "TargetedLocation".
getIdStringReturns the ID of the targeted location.
getNameStringReturns the name of this location.
getResourceNameStringReturns the resource name of the targeted location.
getShoppingCampaignAdsApp.ShoppingCampaignReturns the shopping campaign to which this targeted location belongs or null if it does not belong to a shopping campaign.
getStatsForAdsApp.StatsReturns stats for the specified date range.
getStatsForAdsApp.StatsReturns stats for the specified custom date range.
getTargetTypeStringReturns the target type of this location.
getTargetingStatusStringReturns the targeting status of this location.
getVideoCampaignAdsApp.VideoCampaignReturns the video campaign to which this targeted location belongs or null if it does not belong to a video campaign.
removevoidRemoves the targeted location.
setBidModifiervoidSets the bid modifier for this targeted location.

getBidModifier()

Returns the bid modifier for this targeted location.

The bid modifier is a multiplier applied to bids which match this targeted location. So, for instance, a bid modifier of 1.1 increases the bid to 110% of its original value, and changes a bid of $5.00 to a bid of $5.50.

The bid modifiers for all matching criteria are multiplied together to calculate the actual bid modification. A campaign with the following bid modifiers:

TypeValueBid Modifier
LocationLaos1.3
Ad ScheduleSaturday 6AM-10AM0.9
PlatformMobile1.1
would have a combined bid modifier of 1.3 * 0.9 * 1.1 = 1.287, so a bid of $10 would get increased to $12.87 for metrics.clicks by Laotian smartphone users on Saturday mornings in the account timezone.

For more information about bid modifiers, please see the Google Ads Help Center article.

Return values:

TypeDescription
doubleThe criterion bid modifier.

getCampaign()

Returns the campaign to which this targeted location belongs or null if it does not belong to a search or display campaign.

Return values:

TypeDescription
AdsApp.CampaignThe campaign to which this targeted 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
StringVideo 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
StringThe country code of this location.

getEntityType()

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

Return values:

TypeDescription
StringType of this entity: "TargetedLocation".

getId()

Returns the ID of the targeted location.

Location IDs are shared across campaigns. In order to uniquely identify a location target, one must specify both its campaign ID and the location ID.

Return values:

TypeDescription
StringThe ID of the targeted location.

getName()

Returns the name of this location.

Return values:

TypeDescription
StringThe name of this location.

getResourceName()

Returns the resource name of the targeted location.

Return values:

TypeDescription
StringThe resource name of the targeted location.

getShoppingCampaign()

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

Return values:

TypeDescription
AdsApp.ShoppingCampaignThe shopping campaign to which this targeted location belongs or null if it does not belong to a shopping campaign.

getStatsFor(dateRange)

Returns stats for the specified date range. Supported values:

TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK, LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT, THIS_MONTH, LAST_MONTH, ALL_TIME.

Example:

var stats = targetedLocation.getStatsFor("THIS_MONTH");

Arguments:

NameTypeDescription
dateRangeStringDate range for which the stats are requested.

Return values:

TypeDescription
AdsApp.StatsThe stats for the specified date range.

getStatsFor(dateFrom, dateTo)

Returns stats for the specified custom date range. Both parameters can be either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD form. For instance, March 24th, 2013 is represented as either {year: 2013, month: 3, day: 24} or "20130324". The date range is inclusive on both ends, so forDateRange("20130324", "20130324") defines a range of a single day.

Arguments:

NameTypeDescription
dateFromObjectStart date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.
dateToObjectEnd date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.

Return values:

TypeDescription
AdsApp.StatsThe stats for the specified date range.

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
StringThe 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
StringThe targeting status of this location.

getVideoCampaign()

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

Return values:

TypeDescription
AdsApp.VideoCampaignThe video campaign to which this targeted location belongs or null if it does not belong to a video campaign.

remove()

Removes the targeted location.

Returns nothing.

setBidModifier(modifier)

Sets the bid modifier for this targeted location.

The bid modifier is a multiplier applied to bids which match this targeted location. So, for instance, a bid modifier of 1.1 increases the bid to 110% of its original value, and changes a bid of $5.00 to a bid of $5.50.

The bid modifiers for all matching criteria are multiplied together to calculate the actual bid modification. A campaign with the following bid modifiers:

TypeValueBid Modifier
LocationLaos1.3
Ad ScheduleSaturday 6AM-10AM0.9
PlatformMobile1.1
would have a combined bid modifier of 1.3 * 0.9 * 1.1 = 1.287, so a bid of $10 would get increased to $12.87 for metrics.clicks by Laotian smartphone users on Saturday mornings in the account timezone.

For more information about bid modifiers, please see the Google Ads Help Center article. For locations, acceptable bid modifiers are in the range 0.1 to 10.

Returns nothing.

Arguments:

NameTypeDescription
modifierdoubleThe new bid modifier.