Description Usage Arguments Details Value
View source: R/microsite-traffic.R
fetch_ms_traffic_by_category
downloads data on traffic metrics for
specific types of posts based on the categories they have been assigend in
wordpress during the given dates and returns the data as a tibble.
1 2 3 4 5 6 7 8 9 10 11 12 |
start_date |
The start date as an ISO 8601 string. |
end_date |
The end date as an ISO 8601 string. |
category |
A string representing a category name to filter for with a partial match as a string. |
exclude_lists |
Exclude list pages from results. The default is TRUE. |
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. |
by_page |
A boolean indicating whether to return the results broken down by individual page. The default is FALSE. |
merge_paths |
A boolean indicating whether to aggregate figures for all
pages that have the same root path i.e. for all pages whose paths differ
only by their query strings or internal anchors. This parameter is ignored
if |
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
|
The specific catgeories are identified using a partial, case-insensitive
string match against the custom dimension "dimension1" which lists all tags
associated with each page. By default this includes list pages that contain
posts with those tags, such as the homepage and the category pages. The
exclude_lists
argument is used to exclude these pages from the
results and it is enabed by default.
Traffic figures can be requested by page. Google Analytics treats webpages
requested with different query strings and section anchors as different
pages in its traffic data. You can use the merge_paths
argument to
optionally sum the figures for pages with the same base path. This makes it
easier to calculcate the total number of views each distinct page has
received, but note that this may introduce errors in the number of users, as
a user may visit the same page using URLs with different query strings and
anchors.
A tibble of traffic metrics.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.