Since Python is one of our more popular languages, we’ve updated the Google Analytics Python Client Library to access all 5 feeds of the Management API. Now it’s easier than ever to get your configuration data from the API.
To show you how simple it is to use the library, here is an example which returns all the goal names for a profile:
APP_NAME = 'goal_names_demo'
my_client = gdata.analytics.client.AnalyticsClient(source=APP_NAME)
# Make a query.
query = gdata.analytics.client.GoalQuery(
# Get and print results.
results = my_client.GetManagementFeed(query)
for entry in results.entry:
print 'Goal number = %s' % entry.goal.number
print 'Goal name = %s' % entry.goal.name
print 'Goal value = %s' % entry.goal.value
To get you started, we wrote a reference example which accesses all the important information for each feed. We also added links to the source and PyDoc from the Management API Libraries and Examples page. Have a look and let us know what you think!
By Nick Mihailovski, Google Analytics API Team