0

I am trying to access our site's Web usage statistics through Google Analytics API. I downloaded the Python code from here

http://code.google.com/p/gdata-python-client/

Under samples/analytics folder, there is data_feed_demo.py. I ran it, however this code seems to want an table ID, but in the docs it is not clear where this comes from. On the Web, some suggest to use profile id, others say to look at some URL from the GA admin pages. I tried various sections of such URLs from the GA tool, but the code was not able to get data. Any ideas?

BBSysDyn
  • 4,389
  • 8
  • 48
  • 63

2 Answers2

2

There was an answer here

https://groups.google.com/forum/?fromgroups#!topic/google-analytics-data-export-api/SdprtYcBLP4

When I logged in GA, the URL in the main page is something like

https://www.google.com/analytics/web/?et=#dashboard...a[xxx]w[xxx]p[xxx]/

I took [xxx] out of p[xxx] and gave the sample script as ga:[xxx]. This worked. Funny thing is I remember taking out p values out of the URL before, but I guess I was not on the main page. Anyhow. This is the answer.

BBSysDyn
  • 4,389
  • 8
  • 48
  • 63
0

https://developers.google.com/analytics/solutions/articles/hello-analytics-api

This is the best way to get started with GA api.

maQbex
  • 3
  • 3