La nuova API Search Ads 360 Reporting è ora disponibile. Unisciti al gruppo Google searchads-api-announcements per non perderti i prossimi miglioramenti e release.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Puoi utilizzare SearchAds360FieldService
per richiedere in modo dinamico al catalogo risorse, campi della risorsa,
chiavi di segmentazione e metriche disponibili nei metodi SearchAds360ServiceSearch e SearchStream. Il catalogo fornisce metadati che possono essere utilizzati dai client dell'API Search Ads 360 Reporting per la convalida e la creazione delle istruzioni per il linguaggio di query di Search Ads 360.
Richiesta e risposta HTTP di esempio
La richiesta consiste in un HTTP GET al server dell'API Search Ads 360 Reporting all'URL seguente:
Risorse che possono essere unite implicitamente alla risorsa nella clausola FROM.
metrics
Metriche che possono essere selezionate con la risorsa nella clausola FROM. Compilato solo per i campi in cui category è RESOURCE.
segments
Chiavi di segmento che possono essere selezionate con la risorsa nella clausola FROM.
Questi segmentano le metriche specificate nella query. Compilato solo per i campi in cui il valore category è RESOURCE.
selectableWith
Campi che possono essere selezionati insieme a un determinato campo, quando non nella clausola FROM. Questo attributo è pertinente solo per identificare le risorse o i segmenti che possono essere selezionati in una query se non sono inclusi dalla risorsa nella clausola FROM. Ad esempio, se selezioni ad_group.id
e segments.date da ad_group e vuoi includere gli attributi di
campaign, devi verificare che segments.date sia nell'attributo
selectableWith per la campagna, poiché viene selezionato insieme al
campo segments.date esistente.
Dettagli dei metadati
Puoi richiedere il catalogo utilizzando SearchAds360FieldService a questi livelli:
Risorsa
Ad esempio, searchAds360Fields/campaign.
Campo della risorsa
Ad esempio, searchAds360Fields/campaign.name.
Campo di segmentazione
Ad esempio, searchAds360Fields/segments.ad_network_type.
Metrica
Ad esempio, searchAds360Fields/metrics.clicks.
Utilizzare una query per ottenere i dettagli del campo
È possibile ottenere i dettagli del campo inviando una query a
[null,null,["Ultimo aggiornamento 2025-08-29 UTC."],[[["\u003cp\u003eUse \u003ccode\u003eSearchAds360FieldService\u003c/code\u003e to dynamically retrieve metadata about resources, fields, segmentation keys, and metrics available in Search Ads 360 Reporting API.\u003c/p\u003e\n"],["\u003cp\u003eThis metadata helps in validating and constructing Search Ads 360 Query Language statements for use with the \u003ccode\u003eSearch\u003c/code\u003e and \u003ccode\u003eSearchStream\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eRequest the catalog for resources, resource fields, segmentation fields, and metrics using the specified URL structure.\u003c/p\u003e\n"],["\u003cp\u003eExplore the catalog metadata including \u003ccode\u003eattributeResources\u003c/code\u003e, \u003ccode\u003emetrics\u003c/code\u003e, \u003ccode\u003esegments\u003c/code\u003e, and \u003ccode\u003eselectableWith\u003c/code\u003e for query construction.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the \u003ccode\u003esearch\u003c/code\u003e method of \u003ccode\u003eSearchAds360FieldService\u003c/code\u003e to query for specific field details using regular expressions or specific field names.\u003c/p\u003e\n"]]],["`SearchAds360FieldService` provides a dynamic catalog of resources, fields, segmentation keys, and metrics for `SearchAds360Service`. This service allows clients to validate and construct Search Ads 360 Query Language statements. The catalog can be requested via HTTP GET, for instance, `searchAds360Fields/ad_group`. Responses include `attributeResources`, `metrics`, `segments`, and `selectableWith`. You can also retrieve field details using a query to `searchAds360Fields:search`, allowing for filtering with regular expressions or specific field names.\n"],null,["# Resource Metadata\n\nYou can use [`SearchAds360FieldService`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#google.ads.searchads360.v0.services.SearchAds360FieldService)\nto dynamically request the catalog for resources, resource's fields,\nsegmentation keys and metrics available in the [`SearchAds360Service`](/search-ads/reporting/api/reference/rpc/google.ads.searchads360.v0.services#searchads360service)\n`Search` and `SearchStream` methods. The catalog provides metadata that can be\nused by Search Ads 360 Reporting API clients for validation and construction of Search Ads 360\nQuery Language statements.\n\nSample HTTP request and response\n--------------------------------\n\n| **Note:** The example shows the underlying HTTP/JSON request as a guide, but you are strongly encouraged to use one of the [client libraries](/search-ads/reporting/client-libraries/client-libraries) based on [gRPC](//grpc.io) to submit your requests.\n\nThe request consists of an `HTTP GET` to the Search Ads 360 Reporting API server at the\nfollowing URL: \n\n https://searchads360.googleapis.com/v0/searchAds360Fields/{resource_or_field}\n\nThe following is an example of a request followed by the response returned from\n`SearchAds360FieldService` for **ad_group** resource:\n\n### Request\n\n https://searchads360.googleapis.com/v0/searchAds360Fields/ad_group\n\n### Response\n\n {\n \"resourceName\": \"searchAds360Fields/ad_group\",\n \"name\": \"ad_group\",\n \"category\": \"RESOURCE\",\n \"selectable\": false,\n \"filterable\": false,\n \"sortable\": false,\n \"selectableWith\": [\n \"campaign\",\n \"customer\",\n \"metrics.average_cpc\",\n \"segments.device\",\n ...\n ],\n \"attributeResources\": [\n \"customer\",\n \"campaign\"\n ],\n\n \"metrics\": [\n \"metrics.conversions\",\n \"metrics.search_budget_lost_impression_share\",\n \"metrics.average_cost\",\n \"metrics.clicks\",\n ...\n ],\n \"segments\": [\n \"segments.date\",\n \"segments.ad_network_type\",\n \"segments.device\",\n ...\n ]\n }\n\nFor this example, the important arrays are:\n\n`attributeResources`\n: Resources that can be implicitly joined to the resource in the `FROM`\n clause.\n\n`metrics`\n: Metrics that are available to be selected with the resource in the `FROM`\n clause. Only populated for fields where the `category` is `RESOURCE`.\n\n`segments`\n: Segment keys that can be selected with the resource in the `FROM` clause.\n These segment the metrics specified in the query. Only populated for fields\n where the `category` is `RESOURCE`.\n\n`selectableWith`\n: Fields that can be selected alongside a given field, when not in the `FROM`\n clause. This attribute is only relevant when identifying resources or segments\n that are able to be selected in a query where they are not included by the\n resource in the `FROM` clause. As an example, if you are selecting `ad_group.id`\n and `segments.date` from `ad_group`, and you want to include attributes from\n `campaign`, you would need to check that `segments.date` is in the\n `selectableWith` attribute for campaign, since it's being selected alongside the\n existing `segments.date` field.\n\nMetadata details\n----------------\n\nYou can request the catalog using the `SearchAds360FieldService` at these\nlevels:\n\nResource\n: For example, `searchAds360Fields/campaign`.\n\nResource's field\n: For example, `searchAds360Fields/campaign.name`.\n\nSegmentation field\n: For example, `searchAds360Fields/segments.ad_network_type`.\n\nMetric\n: For example, `searchAds360Fields/metrics.clicks`.\n\nUse a query to get field details\n--------------------------------\n\nIt is possible to get field details by sending a query to \n\n https://searchads360.googleapis.com/v0/searchAds360Fields:search\n\nExample 1: Using a regular expression. \n\n SELECT\n name,\n category,\n selectable,\n filterable,\n sortable,\n selectable_with,\n data_type,\n is_repeated\n WHERE name LIKE 'ad_group.%'\"\n\nExample 2: Querying specific fields, metrics or segments. \n\n SELECT\n name,\n category,\n selectable,\n filterable,\n sortable,\n selectable_with,\n data_type,\n is_repeated\n WHERE\n name IN (\n \"ad_group.id\",\n \"ad_group.name\",\n \"segments.date\",\n \"customer.id\",\n \"customer.manager\",\n \"metrics.clicks\"\n )"]]