rgoogle-analytics-apigoogleauthr

Where to paste oauth2 "success code" using googleAuthR?


I am trying to authenticate to GoogleAuthR running following code

library(googleAnalyticsR)
setwd("C:/work/r_scripts/Analytics")
my_client_id <- "****.apps.googleusercontent.com"
my_client_secret <- "*****-*****"
options(googleAuthR.client_id = my_client_id)
options(googleAuthR.client_secret = my_client_secret)
ga_auth()

then I received a "success code" that popped up in Chrome, saying "please copy this code switch to your application and paste it there". However, I cannot find where to paste it.

Thank you!


Solution

  • The R session should be waiting for you to paste it in when you switch back from your browser - see image below

    enter image description here

    But also see the googleAnalyticsR website’s setup page as this auth flow can happen automatically if you have library(httpv) installed.