The non-sampled reports in Google Analytics allow to obtain data based on 100% of the sessions even in those conditions where the platform applies the sampling. Unsampled reports are currently only available to Google Analytics 360 users.
The request for non-sampled reports in Google Analytics does not provide an immediate response, in fact it can take from several minutes to more than an hour to obtain a downloadable report.
With the Add-on for Spreadsheet ‘GA360 Unsampled‘ it is possible to query the Unsampled Reports API to directly obtain the data without worrying about verifying the actual generation of the results, as they are conveniently retrieved automatically and saved in sheets dedicated to the Spreadsheet used.
Using Google Analytics and looking for a new way to aggregate, store, and efficiently organize the data from your website in a Google Sheet? In this episode of Sheets to Apps, we show you how to combine the Google Analytics add-on with Apps Script, resulting in the automation of cohesive data summaries that are compatible with Google Sites.
In this latest episode Alexandrina Garcia-Verdin demonstrates how the Google Analytics Add-on can be combined with macros to automate regular reporting. The video description has links to all the resources you need to set this up.
Whilst ‘Sheets to Apps’ videos are targeted at low/no coders as an Apps Script Developer I always find it useful to have a look at the code to see how it is done, as more often than not there will be a technique or method I’ve not come across. In the case of this example my new discovery was the .autoFill() and after browsing the documentation, .autoFillToNeighbor() methods in SpreadsheetApp. These methods allow you to replicate the auto-fill functionality users have in Google Sheets.
Another discovery was the various .setOption() calls when building the charts. I’ve used .setOption() in projects in the past and the issue I’ve had is navigating the long list of options you can use for various chart types. Using the macro recorder seems like a great way to capture all the options you want to add to your script project.