artemklevtsov / RGA

A Google Analytics API client for R
http://cran.r-project.org/package=RGA
32 stars 13 forks source link

Authorize() takes to the GA page but R says couldnt resolve host name #31

Closed pallab2110 closed 8 years ago

pallab2110 commented 8 years ago

Hi, I am trying to connect GA through R. I have installed and loaded RGA package. When I am using the authorize() command with my client.id and client.secret, it takes me to the GA page I am trying to access and then the page says Authentication complete. When I return to the R window, the following error message appears.

Access token will be stored in the '.ga-token.rds' file.
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Couldn't resolve host name

I am not being able to figure out what the actual issue is. By the way, I have installed curl package and loaded the same too.

If anyone can kindly help me resolve this please.

Regards, Pallab

artemklevtsov commented 8 years ago

Please update all R-packages. Also please try authorize with the httr::with_verbose:

httr::with_verbose(authorize())
pallab2110 commented 8 years ago

Hi artemklevtsov,

Thanks for your response. But it still gives the same error even after updating packages and using httr::with_verbose. Can u give me some other work around please.

artemklevtsov commented 8 years ago

Please post the output of httr::with_verbose(authorize()) command here.

pallab2110 commented 8 years ago

Here u go.

Access token will be stored in the '.ga-token.rds' file.
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Couldn't resolve host name
pallab2110 commented 8 years ago

Hi, I am wondering what should be the output generally when somebody calls authorize() function with client id and client secret. If anybody could help.

meidata commented 8 years ago

This is a problem of the proxy, your server block the request for api connection, i think you are using the wifi or internet at an organisation (etc company) level, try to switch to an open wifi, it will work.