The aim is to extract un-sampled report from Google Analytics Account(Premium account) using the management api.
I am unable to create report for more than 20 days of data.I am using only one dimension(custom dimension) and one metric(ga:user) as our input parameter.
The API allows us to trigger a report of only 20 days beyond this error is thrown -> "error code :400 Request too expensive to be fulfilled".
Please find the code below.
$unsampledReport = new Google_Service_Analytics_UnsampledReport();
$unsampledReport['start-date'] = '2017-09-01';
$unsampledReport['end-date'] = '2017-12-30';
$unsampledReport->setMetrics('ga:pageviews');
$unsampledReport->setDimensions('ga:contentGroup4');
$unsampledReport->setDownloadType('GOOGLE_DRIVE');
$report_insert = $analytics->management_unsampledReports-
>insert('account_id','property_id,'view_id',$unsampledReport);
This the error being displayed.
> { "code": 400, "errors": [
> {
> "domain": "global",
> "message": "Request is too expensive to fulfill.\nTo learn more about Unsampled Reports please see
> <a href = "https://support.google.com/analytics/answer/2601061">Ans</a>
}