Description Usage Arguments Details Value
View source: R/briefings-traffic.R
fetch_traffic_for_rb_public
downloads data on traffic metrics for a
given research briefing url on the main Parliament website during the given
dates and returns the data as a tibble.
1 2 3 4 5 6 7 8 9 10 |
url |
The URL of a page for which traffic data is requested. |
start_date |
The start date as an ISO 8601 string. |
end_date |
The end date as an ISO 8601 string. |
internal |
A boolean indicating whether to return only the results for traffic from internal parliamentary networks. The default is FALSE. |
by_date |
A boolean indicating whether to return the results broken down by date. The default is FALSE. |
combine |
A boolean indicating whether to combine the totals from different properties or to report them separately. Note that combining the traffic across properties can introduce errors in the number of users, as the same user may visit pages on different properties. The default is FALSE. |
anti_sample |
A boolean indicating whether to use googleAnalyticsR's anti-sample feature, which chunks API calls to keep the number of records requested under the API limits that trigger sampling. This makes the download process slower but ensures that all records are returned. Only use this feature if you see that an API request triggers sampling without it. The default is FALSE. |
use_resource_quotas |
A boolean indicating whether to use the resource
quotas in Parliament's Google Analytics account to prevent sampling.
This is a faster and more effective way to disable sampling than using
|
By default, traffic figures are reported separately for each website
property in Google Analytics that contains some of the requested data. You
can use the combine
argument to optionally combine traffic figures
so that each result appears only once with figures totalled across all
relevant properties. This makes it easier to produce aggregate figures for
traffic across a number of properties, but may introduce errors in the
number of users, as the same user may visit pages on different properties.
A tibble of traffic metrics.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.