python - How do I get dimension data from Analytics reporting api -


I am trying to get statisitcs on top browsers used for my site using analytics reporting API v3 . I'm using the Python version of the API. I am able to query the API and I get a result. I ask using it:

  res = service.data (). Ga (). Get (Aids = 'ga:' + profile_id, start_date = '2014-01-01', end_date = t, matrix = 'ga: session', dimension = 'ja: browser'). Execute ()   

But I do not know how to use the result data. My goal is to get the top 5 browsers, can I get this information either directly or I have to calculate it myself, how can I access data in rows and rows of results?

All this work should have been done in a way so that your numbers are ordered first So set the maximum result to 5, in this way you should only get 5 rows back.

  res = service.data (). Ga (). Get (id = 'ga:' + profile_id, start_date = '2014-01-01', and_data = t, matrix = 'Ga: sessions', dimension = 'ga: browser', sort, '- ga: sessions' , Max_results = '5') .execute ()   

Note: This helps you check which queries and numbers you Can resume in

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

c# - Call function from DLL -