Closed Pascal-Schmidt closed 3 years ago
You need to add the scopes together, getOption("googleAuthR.scopes.selected")
will show you what scopes are active when you authenticate. Combine the two to include analytics and webmaster scopes when you authenticate. Its easiest with the json key file, added as a user to both accounts.
Thanks for the hint. This worked for me.
options(
"googleAuthR.scopes.selected" = c(
"https://www.googleapis.com/auth/webmasters",
"https://www.googleapis.com/auth/webmasters.readonly",
"https://www.googleapis.com/auth/analytics",
"https://www.googleapis.com/auth/analytics.readonly",
"https://www.googleapis.com/auth/analytics.edit",
"https://www.googleapis.com/auth/analytics.manage.users",
"https://www.googleapis.com/auth/analytics.user.deletion"
)
)
I had to include the webmaster.readonly scope though. Would that be the preferred way of authentification?
I think in theory you only need the read.only scopes but it seems some need both /analytics and /analytics.readonly . You have to re-auth each time you change the scopes.
Hi Mark, I have a question regarding authenticating
searchConsoleR
andgoogleAnalyticsR
. When I run the following code below, I can pull data from google analytics but get an error for the search console. When I authenticate google analytics first and then search console I get an error when wanting to pull google analytics data.The error message is
For when wanting to get data from search console.
Do you have an idea how I can solve that issue? Thanks!