1
votes

I would like to schedule a few unsampled reports to run monthly on the first of the month. For each report I need one unsampled report for the previous month, and another for the previous year. Using the GA web interface, I can schedule a monthly report for 6 months, but I don't see a way to schedule a report to include the previous year's worth of data. Some other limitations are that I have to remember to schedule the report every 6 months, and that I can't see what reports have already been scheduled. All of which leads me to the conclusion that I have to use the API if I want to accomplish this.

So first off, according to the documentation, I believe I should be able to do that via the "Unsampled Reports: insert" api method. https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/management/unsampledReports/insert

First off, is that a correct assumption? Does the insert trigger an unsampled report for immediate processing?

Secondly, can I configure a report in the API the same way as I configure it in the web interface? For example, for certain reports I set the type to Flat Table. Not sure how I would specify that in the API or is that irrelevant when it comes to a custom report?

Thirdly, does the output end up in Google Drive the same as if I ran the unsampled report via the web interface?

1

1 Answers

0
votes

I'd strongly recommend reading the developer overview of the unsampled reporting methods of the Management API. It'll give you a good sense of how the process works.

To answer some of your specific questions:

First off, is that a correct assumption? Does the insert trigger an unsampled report for immediate processing?

The process isn't necessarily immediate, but yes it does trigger a new unsampled report for processing.

Secondly, can I configure a report in the API the same way as I configure it in the web interface? For example, for certain reports I set the type to Flat Table.

No you don't get those same report types, you just get data back. You can, however, configure it the same way you'd configure a Core Reporting API request. To play around with how that works, I'd check out the Query Explorer.

Thirdly, does the output end up in Google Drive the same as if I ran the unsampled report via the web interface?

Yes, the end result should be the same.