Generating OAuth tokens from RServer using Google Analytics

Excellent catch! Okay, so I figure that the gs part of gs_auth is "googlesheets" (I missed that initially). I changed the gs to ga (for google analytics) and got a "success code" but when I go to paste that success code back into R , I see that R has the following error message:

options(httr_oob_default=TRUE)
ga_auth(new_user = TRUE)

2018-06-27 10:50:26> Removing old cached credentials from: /home/ONID.OREGONSTATE.EDU/simmongr/.httr-oauth
Enter authorization code: ga_ls()
Error in oauth2.0_access_token(endpoint, app, code = code, user_params = user_params, :
Bad Request (HTTP 400). Failed to get an access token.

That probably doesn't do much in the way of a solution but maybe I am mistaken. I have loaded all the relevant Google Analytics packages, so not sure what's wrong. Thank you!!!

G

1 Like