Get the ID for the Google Analytics API IDS parameter

Google announced an API for the Google Analytics product last week and I posted the start of a PHP class for using the API on Thursday and will post extensions to the class for getting data from the XML this week. In order to get data you need to know the ID for the Google Analytics Account Profile and this post looks at one way to get it without needing any programming code.

Using the Analytics Web Interface

Log into Google Analytics. The table in the main section of the welcome area has a list of your accounts as shown in the example screenshot below. (I have a number of accounts under my login but have Photoshopped them out). Click the account name you want to get the ID for. Where to click is highlighted with the red arrow in the screenshot below.

select the google analytics account

Next you’ll see a list of profiles for the account. Click “View Report” next to the profile you want the ID for. Note that the ID is not the same as the UA-XXXX-XX style code which is shown on this page and what is in the Javascript code that it added to your web pages. Again, the red arrow shows what to click (and I’ve again Photoshopped out the other profiles under this account).

select the analytics profile

Now that you’re on the account profile page look in the browser address bar and you can see the ID there. I’ve highlighted the ID with a red box in the screenshot below. The ID is 7426158 in this example.

get the id from the browser address bar

API Call

The API call to https://www.google.com/analytics/feeds/accounts/default will return a list of all account IDs you have access to with your login and password and is another way to get the IDs. I will show how to do this tomorrow.