Created
September 4, 2018 21:58
-
-
Save voltek62/ad9007a007f9fb53bcbcae887c389f80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(searchConsoleR) | |
# https://dataseolabs.com | |
## authentication with both GA and SC | |
options(googleAuthR.scopes.selected = | |
c("https://www.googleapis.com/auth/webmasters")) | |
googleAuthR::gar_auth() | |
## replace with your GA ID | |
ga_id <- 123456 | |
## date range to fetch | |
start <- as.character(Sys.Date() - 93) | |
end <- "2018-07-20" | |
## Getting the Search Console data | |
# Fix : rowLimit must be 5000 or lower. Got this: 20000 | |
scdata <- search_analytics("https://data-seo.com", | |
startDate = start, endDate = end, | |
dimensions = c("page","query"), | |
rowLimit = max_results, | |
aggregationType = "byPage") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment