Resource Names

Resource names used in the Google Ads API are hierarchical, mirroring the organization of entities within Google Ads. Almost all resources are sub-resources of the Customer resource, which reflects the fact that almost every API call has to target a specific Google Ads account. For example, campaigns, ad groups, ads, and keywords are all sub-resources of a root customer resource.

Resource Resource Name
Customer customers/1234567890
Campaign customers/1234567890/campaigns/8765432109
AdGroup customers/1234567890/adGroups/54321098765
AdGroupAd customers/1234567890/adGroupAds/54321098765~2109876543210

Google Ads entities (customers, campaigns, etc.) are referred to by their resource names throughout the API. However, it’s important to note that the resource names themselves may have unique numerical resource IDs that identify each object in the hierarchy. In these cases, it may be useful to parse the resource name to extract these resource IDs and assemble a new one.

For example, examine the AdGroupAd resource name from the previous table:

customers/1234567890/adGroupAds/54321098765~2109876543210

This can be broken down into its individual resource IDs (separated by collection IDs) as follows:

Resource name components
Resource IDs
customer ID:
"1234567890"
ad group ID:
"54321098765"
ad group ad ID:
"2109876543210"
Collection IDs
"customers"
"adGroupAds"

Parsing the individual IDs allows you to derive new resource names to reference the ad group ad's customer (customers/1234567890) or its ad group (customers/1234567890/adGroupAds/54321098765).