View source: R/report_helpers.R
| get_geographic_performance | R Documentation |
Retrieves performance metrics broken down by country or other geographic dimensions.
get_geographic_performance(
date_range,
end_date = NULL,
ids = "channel==MINE",
dimension = "country",
metrics = c("views", "estimatedMinutesWatched"),
max_results = 25,
...
)
date_range |
Date range string or start date |
end_date |
End date (only needed if date_range is a specific start date) |
ids |
Channel identifier (default: "channel==MINE") |
dimension |
Geographic dimension: "country", "province", or "city" (default: "country") |
metrics |
Vector of metrics to include (default: views, estimatedMinutesWatched) |
max_results |
Number of results to return (default: 25) |
... |
Additional arguments passed to get_report() |
API response with geographic data
## Not run:
# Top countries by views
get_geographic_performance("last_30_days")
# US states/provinces (requires US-only data)
get_geographic_performance("this_month", dimension = "province",
filters = "country==US")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.