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 theFROM
clause.metrics
is a list of fields that can be selected when the resource is used in theFROM
clause. Only populated for fields with thecategory
ofRESOURCE
.segments
is a list of segments fields that can be selected when the resource is used in theFROM
clause. Only populated for fields with thecategory
ofRESOURCE
. 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 theFROM
clause. This attribute is only relevant to identify resources or segments that are not included by the resource in theFROM
clause. For example, if you selectad_group.id
andsegments.date
fromad_group
and want to include attributes fromcampaign
, you need to check thatsegments.date
is in theselectableWith
attribute forcampaign
, because it's being selected together with the existingsegments.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
.