Getting Google Analytics Real Time data (part 1)

Let's see how we could get the real time number on google analytics/

Access the google developpers API page:

https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get?hl=pt-br#try-it

There is a sandbox to test the api: we just need the account ID and the Metrics, then authorize our account to access the information. We can check it real-time on the form at the end of the page:

The main hard point here is to get right the account Id number... the documentation is really bad and after a lot of tests I finally got it right in a lost comment of the google analytics forum :
open your analytics account and look at the xxxx value inside the links on y
The other answers are based on using the OLD VERSION analytics page and are correct that the ID=xxxxxxxx is the profile ID 
https://www.google.com/analytics/reporting/?reset=1&id=XXXXXXXX&pdr=20110702-20110801 

For the NEW VERSION analytic page it is the number at the end of the ERL starting with p 
https://www.google.com/analytics/web/#home/a11345062w43527078pXXXXXXXX/

Commentaires