APP_NAME = 'goal_names_demo'
my_client = gdata.analytics.client.AnalyticsClient(source=APP_NAME)
# Authorize
my_client.client_login(
INSERT_USER_NAME,
INSERT_PASSWORD,
APP_NAME,
service='analytics')
# Make a query.
query = gdata.analytics.client.GoalQuery(
acct_id='INSERT_ACCOUNT_ID',
web_prop_id='INSERT_WEB_PROP_ID',
profile_id='INSERT_PROFILE_ID')
# 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
No comments:
Post a Comment