3 ways to get Google Analytics unsampled data in SSIS

Introduction

In our previous post, we saw how to get data from Google Analytics using SSIS. Once you get going with the drag and drop SSIS Google Analytics Connector, you may bump up to one interesting challenge. If your request includes sessions above a certain threshold, Google may start sampling your data to provide an average for many Metrics. So, how do you make sure your request includes all sessions in the calculation? The following sections will describe a few ways to achieve this.

Google Analytics Data Sampling Tips

There is no way to guarantee 100% Unsampled data in the Standard Google Analytics API call due to restrictions imposed by Google. However, there are a few workarounds that may help you achieve a very high Data Sampling rate.

The most common solution is that if you set the Sampling option to HIGHER_PRECISION, then Google may honor your request up to a certain threshold, but as the dataset grows (e.g., if you select a larger date range), Google may sample your data even though you set HIGHER_PRECISION.

Extract data from Google Analytics in SSIS: Use the Sample Size option to get Unsampled data.

Other ways to get unsampled data from the Google Analytics API

Now, let’s look at a few other ways if the previous approach doesn’t work.

  1. Narrow down your Date range… e.g., Process day by day rather than a full extract. If day by day is also sampling, they try Hour-by-Hour.
  2. Use the Google API to generate and download Unsampled data (We don’t have an article on this, but see the reference below).
  3. Use a Google Analytics 360 Premium Account with the unsampled report feature. You can get this via the Web Interface or call the API to automate the extraction. https://support.google.com/analytics/answer/2601061?hl=en

https://developers.google.com/analytics/devguides/config/mgmt/v3/unsampled-reports
https://support.google.com/analytics/answer/2637192?hl=en&visit_id=1-636288218914624195-2113255108&rd=1

Downloading Unsampled report using Google Analytics 360 API – ZappySys REST API Task

If you are a Google Analytics 360 user and wish to use the API to generate a file and download it in SSIS, refer to the following article. It shows how to call the Google API. It’s not about the Analytics API, but you will get a high-level idea.

https://zappysys.com/blog/get-data-google-spreadsheet-using-ssis/

Posted in Google API, SSIS Google Analytics Source and tagged , , , .