Proper input of Google Analytics API credentials

问题内容:

I need to export data from google analytics API and for the below I got errors:

ga$getData(5A537372, start.date = "2017-12-01", end.date = "2017-12-10", 
           metrics = "ga:itemR", dimensions = "ga:productR", 
           sort = "", filters = "", segment = "", batch = TRUE, walk = TRUE)

Just to mantion that the code indentation is fine, I’ve wrote all in single line, here is in this format to be easier to look.

For exactly this code I got an Error: unexpected symbol in "ga$getData(3A63528988"

If I change the first parameter in to: ids = "ga:5A537372" I got an

Error in ga$getData(ids = "ga:5A537372", start.date = "2017-12-01",  : 
  error in fetching data: Invalid value 'ga:5A537372'. Values must match the following regular expression: 'ga:[0-9]+'

And there is some other variation of the first parameter with the same error as the last one.

So, what is the correct way to type ids from google analytics API in rga function code?

Thanks.

问题评论:

原文地址:

https://stackoverflow.com/questions/47756751/proper-input-of-google-analytics-api-credentials

添加评论

友情链接:蝴蝶教程