I have a problem with getting data via Google Analytics Reporting API. Here is my v4 GA Reporting API query for YESTERDAY data:
curl -H "Authorization: Bearer %ACCESS_TOKEN%" -H "Content-Type: application/json" "https://analyticsreporting.googleapis.com/v4/reports:batchGet" -d '{"reportRequests":[{"viewId":"%VIEW_ID%","dateRanges":[{"startDate":"2017-11-27","endDate":"2017-11-27"}],"dimensions":[{"name":"ga:adContent"},{"name":"ga:keyword"}],"dimensionFilterClauses":[{"operator":"AND","filters":[{"dimensionName":"ga:source","operator":"EXACT","expressions":["%MY_FILTER%"]}]}],"metrics":[{"expression":"ga:transactions","formattingType":"INTEGER"},{"expression":"ga:transactionRevenue","formattingType":"FLOAT"}]}]}'
I get correct answer with returned data in JSON format.
But this query for TODAY data is failed with answer
{
"error": {
"code": 503,
"message": "The service is currently unavailable.",
"status": "UNAVAILABLE"
}
}
This behavior of system repeats if I am trying to use v3 GA Reporting API. "YESTERDAY" query
curl -H "Authorization: Bearer %ACCESS_TOKEN%" "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:%VIEW_ID%&dimensions=ga:adContent&metrics=ga:goal1Completions&start-date=2017-11-27&end-date=2017-11-27&start-index=1&max-results=50"
returns correct data. "TODAY" query
curl -H "Authorization: Bearer %ACCESS_TOKEN%" "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:%VIEW_ID%&dimensions=ga:adContent&metrics=ga:goal1Completions&start-date=2017-11-28&end-date=2017-11-28&start-index=1&max-results=50"
returns error
{"error":{"errors":[{"domain":"global","reason":"internalError","message":"There was an internal error."}],"code":500,"message":"There was an internal error."}}
Also there is no such problem with another google analytics accounts.
Can anyone help me understand what I'm doing wrong?