I download some data from Google Analytics using the Google Api Client for Ruby (my Gemfile.lock is its google-api client (0.6.4)). I get data from google, but it is so much that it comes (or at least should) on several pages (more than 1000 lines).
I tried using an example from google (part of my code below)
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
}
}
loop do
result = api.execute(request)
results << result
break unless result.next_page_token
request = result.next_page
end
Well ... that doesn't work.
result.next_page_token #returns always nil
I am using the Google Analytics API (v3)
source
share