Search code examples
pythongoogle-analyticsgoogle-apigoogle-analytics-api

Query all data of a Google Analytcs account


I'm using Google Analytics API to make a Python program.

For now it's capable to make specific querys, but...

Is possible to obtain a large JSON with all the data in a Google Analytics account?

I've been searching and i didn't have found any answer.

Someone know if it's possible and how?


Solution

  • The Google Analytics api lets you request data using

    • A maximum of 7 dimensions in any query.
    • A maximum of 10 metrics for any query.

    You could request data from 2005 - Now and get all the data back for that query. However you need to remember that large amounts of data will probably return sampled so the data wont be as accurate as if you returned a smaller amount of data. Even making more then one request and storing the data in a database isn't going to help you because there is no primary key to link data from one request to another.

    API Limits:

    There are also limits to the API as Eike stated in the comment below. Each request returns 10000 rows of data if there is more data then you need to make another request to get the next 10000 rows. You can make a max of 10000 requests a day against each view. Once you have hit that max you cant make any more requests that day to that view.

    Answer: No there is no way of downloading ALL of your Google Analytics data.