4
我使用Google Api Client for Ruby(我的Gemfile.lock sais其google-api-client(0.6.4))從Google Analytics下載一些數據。我從谷歌獲取數據,但它的內容太多了(或至少應該)在幾頁(超過1000行)。谷歌分析API - 分頁
我試圖用從谷歌(下面我的代碼部分)
request = {
:api_method => analytics.data.ga.get,
:parameters => {
'ids' => "ga:" + ids,
'start-date' => start_date,
'end-date' => end_date,
'dimensions' => dimensions,
'metrics' => metrics,
'max-results' => 10 #only for testing
}
}
loop do
result = api.execute(request)
results << result
break unless result.next_page_token
request = result.next_page
end
好例子...它不工作。
result.next_page_token #returns always nil
我使用Google Analytics API(V3)