We can not find a way to use segments with runReport method.
Tried to get reports with segments in Google Analytics, we can get them like below.
But now, there's no property for them in parameters of the "runReport" method in Google Analytics Data API v1alpha.
ref: Method: runReport
- entity
- dimensions[]
- metrics[]
- dateRanges[]
- offset
- limit
- metricAggregations[]
- dimensionFilter
How should we request "runReport" with segments?
Creating segments on the fly (inside the report query) is currently not supported in the Google Analytics Data API. However, you can use the Google Analytics UI to define an audience which specifies a desired segment criteria. Once the audience is created, you can use the Google Analytics Data API to query audiences using the audienceName dimension.
Thanks, Ilya
The Google Analytics Team