Tag: google-analytics

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)

Export data from Google Analytics with R library RGA

问题内容: If I have google analytics link like this: https://www.googleapis.com/analytics/v3/data/ga?ids=ga%5A6389839&start-date=yesterday&end-date=yesterday&metrics=ga%3Apageviews&dimensions=ga%3ApagePath%2Cga%3Adimension4%2Cga%3Adimension What are the credentials to input in code below (ga$getData, ids, metrics and dimension are troubles) : ga$getData(ids, batch = TRUE, start.date, end.date, metrics = "ga:visits", dimensions = "ga:date,ga:medium,ga:source", sort = "", filters = "", segment = "") I have tried with so many inputs,

Google analytics API is really slow

问题内容: I have a small function that gets the page- and visitor count from Google Analytics for each URL in an array. $filter_path = $my_url; $filter = 'pagePath =@ ' . $filter_path; $ga->requestReportData(ga_profile_id,array('pagePath'),array('pageviews','visitors'),'',$filter,'2010-01-01',date('Y-m-d')); foreach($ga->getResults() as $result) { $pageviews = $result->getPageviews(); $visits = $result->getVisitors(); } This works, but 10 URLs takes about 1-2 minutes to process.