I'm attempting to use the Google Analytics Core Reporting API to query for some filtered sessions data. Filter A returns results, filter B returns results, but applying filter A OR B returns no results. Am I missing something?
Filtering by one custom dimension with an exact match:
curl -X GET -H "Authorization: OAuth <redacted>"
"https://www.googleapis.com/analytics/v2.4/data
?ids=ga:<redacted>
&metrics=ga:sessions
&start-date=2014-06-01
&end-date=2016-05-25
&filters=ga:dimension1==MyMatchString"
Returns
<dxp:aggregates>
<dxp:metric name="ga:sessions" type="integer" value="12345"/>
</dxp:aggregates>
Filtering by another custom dimension with an exact match:
curl -X GET -H "Authorization: OAuth <redacted>"
"https://www.googleapis.com/analytics/v2.4/data
?ids=ga:<redacted>
&metrics=ga:sessions
&start-date=2014-06-01
&end-date=2016-05-25
&filters=ga:dimension2==MyMatchString"
Returns
<dxp:aggregates>
<dxp:metric name="ga:sessions" type="integer" value="67890"/>
</dxp:aggregates>
But filtering with either custom dimension having an exact match
curl -X GET -H "Authorization: OAuth <redacted>"
"https://www.googleapis.com/analytics/v2.4/data
?ids=ga:<redacted>
&metrics=ga:sessions
&start-date=2014-06-01
&end-date=2016-05-25
&filters=ga:dimension1==MyMatchString,ga:dimension2==MyMatchString"
Returns no results:
<dxp:aggregates>
<dxp:metric name="ga:sessions" type="integer" value="0"/>
</dxp:aggregates>
I also tried these same requests with v3 of the API but had the same result.
samplingLevel : HIGHER_PRECISION
. – Manoj PurohitsamplingLevel : HIGHER_PRECISION
had no effect. By web interface do you mean ga-dev-tools.appspot.com/query-explorer ? I can't use that to test this because I don't own the Analytics account to authorize it--it's one of our client's and I only have the refresh_token. – mbil