targeting
Manage custom targeting keys, values, and ad unit configurations in Google Ad Manager to define audience segments for line items.
Instructions
Manage GAM custom targeting keys, values, and ad unit targeting configuration.
MODE: mixed (read + write) AUTH: OAuth 2.0 required CREDITS: Reads = 0. Writes = 0.5 credits. OUTPUT: Returns CustomTargetingKey objects with id, name, type (PREDEFINED/FREEFORM), and associated values. get_available_countries/languages/devices return canonical lists for geographic/device targeting. WHEN TO USE: Use targeting to manage the custom targeting vocabulary (keys and values) used in line item targeting. Use line_items to apply targeting to line items. Use inventory for ad unit structure. NOTE: get_inventory_forecast takes targeting criteria and returns estimated available impressions — useful before creating a line item to verify reach.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Sub-operation to perform: • list_ad_units: List all ad units with their sizes and status. Read-only. For full hierarchy, use inventory get_ad_unit_tree. • validate_fluid: Validate a fluid targeting expression for syntax and reference errors. Read-only. • list_custom_targeting_keys: List all custom targeting keys on the network. Read-only. • get_inventory_forecast: Get estimated available impressions for a targeting specification. Read-only. Use before creating a line item to validate reach. • create_custom_targeting_key: Create a new custom targeting key. Write. • create_custom_targeting_values: Create one or more values for an existing key. Write. • update_custom_targeting_key: Update a key's name or type. Write. • delete_custom_targeting_key: Delete a targeting key and all its values. Destructive write. • update_custom_targeting_value: Update a targeting value's name or display name. Write. • perform_custom_targeting_value_action: Activate or deactivate a targeting value. Write. • search_ad_units: Search ad units by name or path. Read-only. • update_ad_unit: Update an ad unit's name, description, or size. Write. • archive_ad_unit: Archive an ad unit. Destructive write. Run inventory find_inactive_ad_units first. • get_custom_targeting_values: Get all values for a specific targeting key. Read-only. • search_custom_targeting: Search targeting keys and values by text. Read-only. • get_available_countries: Return the canonical list of countries for geographic targeting (ISO 3166-1 alpha-2 codes). • get_available_languages: Return the canonical list of language codes for language targeting. • get_device_categories: Return the canonical list of device categories (DESKTOP, MOBILE, TABLET, CONNECTED_TV). | |
| network_code | No | GAM network code (e.g. 12345678). Required for all network-scoped operations. Obtain via select_gam_network or list_accessible_networks. |