How to pull large data sets with over 1 million rows from Google Analytics and avoid sampling?
How to pull the same data across multiple Google Analytics profiles?
This post provides a solution for exporting more than 10,000 rows (the example pulls over 1 millions rows) and a solution for the sampling limitations of Google Analytics. The solution uses the Google Analytics reporting API and Python. It checks for the presence of sampling before running a query and gives you the ability to break your query down into smaller 10,000 row pieces. The pieces are multiple smaller queries with shorter date ranges. All the data from the small queries are stitched together and output into a single CSV file for the full date range. With this solution you can also pull data from multiple profiles using this single Python application. If you work across multiple Google Analytics profiles with high traffic volumes and often run into sampling, then this solution should save you lots of time. If you’d like to see how to use the Google Analytics Sheets Add-on to pull more than 10k rows of data and avoid sampling check out my previous post.