Ok. I think that I found the problem.
The code that doesn't work above results in the following request to
the analytics api:
https://www.googleapis.com/analytics/v3/data/ga?alt=json&key=XXXX&prettyPrint=false&dimensions=ga%3AeventLabel&end-date=2012-01-03&filters=ga%3AeventCategory%3D%3DPropertyDetails.V1%3Bga%3AeventAction%3D%3DPropertyDetail.Show%3Bga%3AeventLabel%3D~.*(%2F.*)%7B2%7D%2F%5B0-9%5D*%2F&ids=ga%3AXXXXXX&metrics=ga%3AtotalEvents&sort=-ga%3AtotalEvents&start-date=2011-12-04
In the repose for the request above the query element has the
following json structure:
"query":
{
"start-date":"2011-12-04",
"end-date":"2012-01-03",
"ids":"ga:XXXXX",
"dimensions":"ga:eventLabel",
"metrics":["ga:totalEvents"],
"sort":["-ga:totalEvents"],
"filters":"ga:eventCategory==PropertyDetails.V1;ga:eventAction==PropertyDetail.Show;ga:eventLabel=~.*(/.*)
{2}/[0-9]*/",
"start-index":1,
"max-results":1000
}
Notice that the value of the "dimensions" property is declared as
"ga:eventLabel" and the property
Google.Apis.Analytics.v3.Data.GaReport.QueryData.Dimensions, in
the .Net client libraries, is declared as a
System.Collections.Generic.IList<string>. I.e. the jsonconverter
obviously fails to convert the string "ga:eventLabel" to
System.Collections.Generic.IList<string>. If I compare the json
declaration of the "metrics" property, ["ga:totalEvents"] (declared as
an array), which also is declared as a
System.Collections.Generic.IList<string> in the client libraries, my
conclusion is that there is a bug in the analytics v3 api or in the
client libraries.
If it’s a bug in the analytics api, which I think, the "dimensions"
property should be corrected and declared as an array, i.e.
["ga:eventLabel"] in the json response.
If it’s a bug in the client libraries, the property
Google.Apis.Analytics.v3.Data.GaReport.QueryData.Dimensions should be
declares as a string.
Comments?