Hi,When we try to obtain data via the Core Reporting API v3.0 using the request below, we receive a "bad request error". The details below were obtained using OAuth 2.0 playground.The same query works fine using the Data Feed Query Explorer, which is based on version 2.4 of the API.The culprit seems to be the segment bit. If we remove the "segment=dynamic::ga:medium==CPC" part, the query works flawlessly, but the syntax seems to be correct. The problem still happens when I use the "==" in encoded form (i.e. %3D%3D).Any help on this issue would be greatly appreciated.Kind regards,Junior------------------------------------------ REQUEST: GET /analytics/v3/data/ga?ids=ga:XXXXXX&dimensions=ga:keyword,ga:medium&metrics=ga:bounces,ga:visits,ga:adClicks,ga:adCost,ga:impressions,ga:goal2Completions,ga:goal3Completions,ga:goal4Completions,ga:goal5Completions,ga:goalCompletionsAll&segment=dynamic::ga:medium==CPC&max-results=10000&prettyPrint=true&start-date=2012-01-01&end-date=2012-01-01&start-index=1 HTTP/1.1 Host: www.googleapis.com Authorization: OAuth ya29.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ------------------------------------------ RESPONSE: HTTP/1.1 400 Bad Request status: 400 content-length: 172 x-xss-protection: 1; mode=block x-content-type-options: nosniff expires: Fri, 20 Jan 2012 12:02:08 GMT x-google-cache-control: remote-fetch server: GSE via: HTTP/1.1 GWA cache-control: private, max-age=0 date: Fri, 20 Jan 2012 12:02:08 GMT x-frame-options: SAMEORIGIN content-type: application/json; charset=UTF-8 -content-encoding: gzip { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid Value" } ], "code": 400, "message": "Invalid Value" } }
The following dimensions and metrics are not allowed in advanced segment expressions:"
In this instance, we are not using the "disallowed" metrics in the segment expression, we are merely including them in the results. We segment by ga:medium.
As for recap, the following query string does not work:
After stripping off the dynamic segment, it works fine:
Or, if we keep the segment but remove the offending metric (ga:impressions) it also works fine:
For the moment we will just assume "Disallowed Segment Metrics" means "do not include those metrics if we are going to use segments, but any additional information about this issue would be greatly appreciated.
Kind regards,
Junior