Retrieve resource metadata in the Search Ads 360 Reporting API

Stay organized with collections Save and categorize content based on your preferences.

SearchAds360FieldService allows you to retrieve metadata for resources. You can use this service to dynamically request the catalog for resources, resource's fields, segmentation keys, and metrics available in the SearchAds360Service.Search and SearchAds360Service.SearchStream methods. See Search service for more information.

The catalog provides metadata that Search Ads 360 Reporting API clients use to validate and construct Search Ads 360 Query Language statements.

Sample HTTP request and response

The request consists of an HTTP GET to the Search Ads 360 Reporting API server at the following URL:

https://searchads360.googleapis.com/VERSION_NUMBER/searchAds360Fields/RESOURCE or FIELD

The following is an example of a request followed by the response returned from SearchAds360FieldService for the ad_group resource:

Request:

https://searchads360.googleapis.com/v0/searchAds360Fields/ad_group

Response:

{
  "resourceName": "searchAds360Fields/ad_group",
  "name": "ad_group",
  "category": "RESOURCE",
  "selectable": false,
  "filterable": false,
  "sortable": false,
  "selectableWith": [
    "campaign",
    "customer",
    "metrics.average_cpc",
    "segments.device",
    ...
  ],
  "attributeResources": [
    "customer",
    "campaign"
  ],

  "metrics": [
    "metrics.conversions",
    "metrics.search_budget_lost_impression_share",
    "metrics.average_cost",
    "metrics.clicks",
    ...
  ],
  "segments": [
    "segments.date",
    "segments.ad_network_type",
    "segments.device",
    ...
  ]
}
  • attributeResources are resources that can be implicitly joined to the resource in the FROM clause.
  • metrics is a list of fields that can be selected when the resource is used in the FROM clause. Only populated for fields with the category of RESOURCE.
  • segments is a list of segments fields that can be selected when the resource is used in the FROM clause. Only populated for fields with the category of RESOURCE. These fields segment the metrics selected in the query. See Segmentation to learn more.
  • selectableWith lists the fields that can be selected together with the resource field when it is not in the FROM clause. This attribute is only relevant to identify resources or segments that are not included by the resource in the FROM clause. For example, if you select ad_group.id and segments.date from ad_group and want to include attributes from campaign, you need to check that segments.date is in the selectableWith attribute for campaign, because it's being selected together with the existing segments.date field.

See Reference documentation for more information.

Metadata details

You can request the catalog using the SearchAds360FieldService at these levels:

Resource
For example, searchAds360Fields/campaign.
Resource field
For example, searchAds360Fields/campaign.name.
Segmentation field
For example, searchAds360Fields/segments.ad_network_type.
Metrics field
For example, searchAds360Fields/metrics.clicks.