AbdFatah / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

Returned query.dimensions is not a list #260

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Name of affected component: Core Reporting API (Python)

Issue summary:
query.dimensions is expected to be a list as per the documentation however it 
is a concatenated string. 
https://developers.google.com/analytics/devguides/reporting/core/v3/reference#re
sponse_fields 

Steps to reproduce issue:
1. Establish a service object as per the python tutorial 
2. call data().ga().get(...).execute() with several queries and dimensions 
3. Inspect results.get('query').get('dimensions') - object is a string where as 
results.get('query').get('metrics') is as described in the documentation 

Expected output:
[u'ga:productSku', u'ga:productCategory', u'ga:productName']
[u'ga:itemQuantity', u'ga:itemRevenue']

Actual results:
ga:productSku,ga:productCategory,ga:productName
[u'ga:itemQuantity', u'ga:itemRevenue']

Notes:
sample code 
>>> profile_id = 'YOUR-PROFILE-ID-HERE'
>>> date_string = datetime.date.today().strftime('%Y-%m-%d')
>>> results = service.data().ga().get(
        ids= 'ga:' + profile_id,
        start_date = date_string,
        end_date = date_string,
        dimensions = 'ga:productSku,ga:productCategory,ga:productName',
        metrics = 'ga:itemQuantity,ga:itemRevenue'
        max_results = '10').execute()

>>> print results.get('query').get('dimensions')
>>> print results.get('query').get('metrics')

Original issue reported on code.google.com by chris.ha...@fastwebmedia.com on 30 Jan 2013 at 11:19