Export data from Google Analytics API with rga in R

问题内容:

Let’s assume that the google api link start like this:
https://www.googleapis.com/analytics/v3/data/ga?ids=ga%29A5366921&start-date
And now I need to export data from, but for the code below I got errors:

ga$getData(29A5366921, batch = TRUE, '2017-12-01', '2017-12-10', 
           metrics = "ga:visits", dimensions = "ga:date", 
           sort = "", filters = "", segment = "",
           start = 1, max = 1000)

One of the errors (others are pretty much the same, just for different parameter): unexpected ',' in " start = 1,"
I don’t have ‘,’ anywhere between ”, commas are here just to separate the parameters, but this is the first time in my life I trying to use R and maybe there is some hidden rule.

Not sure what to type at the beginning of the code, instead ga$getData did I need to type 29A5366921$getData?

I’m using rga library.

Any help is welcomed. Thanks in advance.

问题评论:

    
Did you try making it all single line? or try adding + at the end of every line.
    
@amrrs I have made it in single line, but now error is : Error in if (sort != “”) { : argument is of length zero . And when I change that with NULL, I got next Error: unexpected symbol in “ga$getData(29A5366921”
– jovicbg
3 hours ago

原文地址:

https://stackoverflow.com/questions/47753120/export-data-from-google-analytics-api-with-rga-in-r

添加评论

友情链接:蝴蝶教程