I am using RGA package to import GA data. For that matter, I have a scheduled cron job. It was working fine so far since years but I recently started getting:
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Please point your browser to the following url:
Why is it that it comes only when job runs through cron.
If I go and run this manually in RStudio though, It runs fine without any issues.
Here's the code:
# Load up the RGA package. This is the package that has the smarts to actually
# connect to and pull data from the Google Analytics API
Sys.setenv(HADOOP_CMD="/usr/bin/hadoop")
library(RGA)
library(rhdfs)
#Authentication
options(httr_oob_default=FALSE)
viewIds <- c( "ga:xxxxxxxx");
fileNames <- c();
token <- authorize(client.id = "ID.apps.googleusercontent.com", client.secret ="SECRET", cache = "/home/rstudio/gaToken3")
print("token in ga")
print(token)