Google Analytics API - Super simple?

5,251

If you have experience programming in PHP and API's and you plan to only use the data from your own account the simplest method would be to use GAPI http://code.google.com/p/gapi-google-analytics-php-interface/

With this you hard code your Google email and password to gain access it does not use OAuth.

If you are building a 3rd party application that others will use to gather data. You should absolutely use OAuth so tokens are used and not passwords. For this read the OAuth guide https://developers.google.com/gdata/articles/oauth

Then use the Analytics data explorer to authenticate, and build a query URL. Take this URL and go to the OAuth Playground, go through the authentication process and post the URL. You will then see the XML response from Google Analytics with the data you wanted, now you can use the data however you want.

Google Analytics API v3 PHP Beta libraries from Goolge https://developers.google.com/analytics/devguides/reporting/core/v3/gdataLibraries

Share:
5,251

Related videos on Youtube

Jens Törnell
Author by

Jens Törnell

Updated on September 18, 2022

Comments

  • Jens Törnell
    Jens Törnell over 1 year

    Google Analytics API - Too complicated?

    I've read about Google Analytics API but heard of others that it is a bit complicated to make it work. I use PHP.

    Copy / paste example

    My question is if there is a copy / paste example anywhere on the web for getting a stats curve of the latest month, or just the numbers for that period?

    Important

    I need to use the new Google Analytics API version for 2012. The other one is going to die soon.