Search code examples
google-analyticsgoogle-analytics-api

Google Analytics Add-on limitaions


I would like to get some data from GA via spreadsheet add-on as I did a few weeks ago (I gathered ~200 000 rows). I am using same metrics, dimensions and rest of the settings but I am still getting this error :

https://i.sstatic.net/hTpIg.png

I found that I will get some data when I do not set up "max-results", but the default is set up on 1000 which is not enough for my needs. Why?

What I have tried to solve this problem and it doesn’t work:

  1. change GA views
  2. change dimensions and metrics
  3. change time range
  4. create new spreadsheet
  5. set up sharing settings of spreadsheet to "public on web"

I found the link regarding limits and quotas on API (https://developers.google.com/analytics/devguides/config/mgmt/v3/limits-quotas#) and I should pass only through 50 000 requests per project, which I actually exceed on the first run, so another question how is it even possible to get more data than I suppose to get?

Should I really order more request or does "request" mean anything else than "one row"? Second why or what?

There is no any interpretation for the error.

Perhaps I am missing something, appreciate your help.


Solution

  • In short: while one could only guess what causes your problem it's most certainly not the API limit. Rows and requests are not at all the same, every request may fetch up to 10,000 rows.

    "Request" is a call to the API, which might include one or many rows of data (unless your script somehow only requests one row at a time, which would be unusual).

    If you exceeded your API quota the error message would say pretty much that.

    The default is 1000 rows because that's a sensible default (compromise between convenience and performance). The API will return max 10,000 rows per request. To fetch 200 000 results the Add-on would have to do 20 requests, not 50 000.

    Also a Google spreadsheet support 2mio cells at max, this might be exceeded by your result set.

    "Service error" is a very unspecific error message which can be caused by a variety of causes from out-of-bound ranges to script timeouts or network latency. Sometimes the spreadsheet service dumps an additional error message in the browser console, so you should check your developer tools.