View source: R/gads_get_metadata.R
| gads_get_metadata | R Documentation |
Get metada of object, RESOURCE, ATTRIBUTE, METRIC or SEGMENT
gads_get_metadata(
category = c("RESOURCE", "ATTRIBUTE", "METRIC", "SEGMENT", "ALL"),
fields = c("name", "category", "data_type", "selectable", "filterable", "sortable",
"selectable_with", "metrics", "segments", "is_repeated", "type_url", "enum_values",
"attribute_resources")
)
category |
Object category |
fields |
Metadata fields |
tibble with object metadata important arrays in result:
Resources that can be using in resource argument in gads_get_report.
Metrics that are available to be selected with the resource in the field argument in gads_get_report. Only populated for fields where the category is RESOURCE.
Segment keys that can be selected with the resource in the field argument in gads_get_report. These segment the metrics specified in the query. Only populated for fields where the category is RESOURCE.
Fields that can be selected alongside a given field, when not in the FROM clause. This attribute is only relevant when identifying resources or segments that are able to be selected in a query where they are not included by the resource in the FROM clause. As an example, if we are selecting ad_group.id and segments.date from ad_group, and we want to include attributes from campaign, we would need to check that segments.date is in the selectableWith attribute for campaign, since it's being selected alongside the existing segments.date field.
The Query Builder Blog Series: Part 3 - Creating a Resource Schema and Resource Metadata API documentation
## Not run:
# get resource list
resources <- gads_get_metadata("RESOURCE")
# get list of all objects
metadata <- gads_get_metadata("ALL")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.