type GeoTargeting (v202408)
Stay organized with collections
Save and categorize content based on your preferences.
Provides line items the ability to target geographical locations.
By default, line items target all countries and their subdivisions.
With geographical targeting, you can target line items to specific
countries, regions, metro areas, and cities. You can also exclude
the same.
The following rules apply for geographical targeting:
- You cannot target and exclude the same location.
- You cannot target a child whose parent has been excluded. For
example, if the state of Illinois has been excluded, then you
cannot target Chicago.
- You must not target a location if you are also targeting its
parent. For example, if you are targeting New York City, you must
not have the state of New York as one of the targeted
locations.
- You cannot explicitly define inclusions or exclusions that are
already implicit. For example, if you explicitly include
California, you implicitly exclude all other states. You therefore
cannot explicitly exclude Florida, because it is already implicitly
excluded. Conversely if you explicitly exclude Florida, you cannot
explicitly include California.
- Namespace
-
https://www.google.com/apis/ads/publisher/v202408
Field
|
targetedLocations
|
Location[]
The geographical locations being targeted by the LineItem.
|
excludedLocations
|
Location[]
The geographical locations being excluded by the LineItem.
|
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-06 UTC.
[null,null,["Last updated 2025-08-06 UTC."],[[["\u003cp\u003eGeoTargeting allows ad targeting or exclusion based on countries, regions, metro areas, and cities.\u003c/p\u003e\n"],["\u003cp\u003eThere are specific rules for geographical targeting to avoid conflicts, like not targeting and excluding the same location.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify \u003ccode\u003etargetedLocations\u003c/code\u003e and \u003ccode\u003eexcludedLocations\u003c/code\u003e using the \u003ccode\u003eLocation\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eGeoTargeting is applied within the \u003ccode\u003eTargeting\u003c/code\u003e section of various services such as LineItemService and ProposalLineItemService.\u003c/p\u003e\n"],["\u003cp\u003eBy default, all countries and their subdivisions are targeted if no geographical targeting is defined.\u003c/p\u003e\n"]]],["The content outlines the functionality of `GeoTargeting` for line items, enabling the targeting or exclusion of specific geographical locations like countries, regions, and cities. Key actions include defining `targetedLocations` and `excludedLocations`. Rules restrict targeting and excluding the same location, targeting a child if its parent is excluded, targeting a parent and a child location, and explicit inclusions/exclusions that contradict implicit ones. This feature is used with the listed services, including `AdRuleService`, `LineItemService`, and `ProposalService`.\n"],null,["# type GeoTargeting (v202408)\n\n**Service** \n[AdRuleService](/ad-manager/api/reference/v202408/AdRuleService.GeoTargeting) [AdjustmentService](/ad-manager/api/reference/v202408/AdjustmentService.GeoTargeting) [ForecastService](/ad-manager/api/reference/v202408/ForecastService.GeoTargeting) [LineItemService](/ad-manager/api/reference/v202408/LineItemService.GeoTargeting) **NativeStyleService** [ProposalLineItemService](/ad-manager/api/reference/v202408/ProposalLineItemService.GeoTargeting) [ProposalService](/ad-manager/api/reference/v202408/ProposalService.GeoTargeting) [PublisherQueryLanguageService](/ad-manager/api/reference/v202408/PublisherQueryLanguageService.GeoTargeting) [TargetingPresetService](/ad-manager/api/reference/v202408/TargetingPresetService.GeoTargeting) [YieldGroupService](/ad-manager/api/reference/v202408/YieldGroupService.GeoTargeting) **Dependencies** \n[Targeting](/ad-manager/api/reference/v202408/NativeStyleService.Targeting) \n▼\n**GeoTargeting**\n\n\nProvides line items the ability to target geographical locations.\nBy default, line items target all countries and their subdivisions.\nWith geographical targeting, you can target line items to specific\ncountries, regions, metro areas, and cities. You can also exclude\nthe same.\n\nThe following rules apply for geographical targeting:\n\n- You cannot target and exclude the same location.\n- You cannot target a child whose parent has been excluded. For example, if the state of Illinois has been excluded, then you cannot target Chicago.\n- You must not target a location if you are also targeting its parent. For example, if you are targeting New York City, you must not have the state of New York as one of the targeted locations.\n- You cannot explicitly define inclusions or exclusions that are already implicit. For example, if you explicitly include California, you implicitly exclude all other states. You therefore cannot explicitly exclude Florida, because it is already implicitly excluded. Conversely if you explicitly exclude Florida, you cannot explicitly include California.\n\n*** ** * ** ***\n\nNamespace\n:\n `https://www.google.com/apis/ads/publisher/v202408`\n\n| Field ----- ||\n|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ### `targetedLocations` | ` `[Location](/ad-manager/api/reference/v202408/NativeStyleService.Location)`[]` The geographical locations being targeted by the [LineItem](/ad-manager/api/reference/v202408/ForecastService.LineItem). |\n| ### `excludedLocations` | ` `[Location](/ad-manager/api/reference/v202408/NativeStyleService.Location)`[]` The geographical locations being excluded by the [LineItem](/ad-manager/api/reference/v202408/ForecastService.LineItem). |"]]