How to use the Google Analytics API?

Asked

Viewed 700 times

3

The examples, the registration in the Google Developers Console, I found everything very convoluted.

How to create a "simple" PHP Hello Analytics?

  • http://blog.thiagobelem.net/pegando-dados-do-google-analytics-via-php/

  • Thanks for the link, but this method no longer works.

  • As I did not test, I preferred to just comment and not post an answer. Good luck.

  • Documentation of goog It’s usually terrible. Full of errors, and always outdated. To implement a Single Sign On solution I lost hours and hours. Now she’s a beauty, but it only works because I’ve researched other solutions that already worked. The PHP api (at least 1.3.1, which I saw) is pretty good, it’s not like them. I learned to use a little by looking at the source and the examples folder, to complement the limits of documentation.

  • Link to API in PHP: https://code.google.com/p/google-api-php-client/

1 answer

2

I managed to solve the same problem that way:

In the Console, you need to create an authorization for Oauth and Public API Access.

Both must request access from the http://localhost, if you are accessing locally.

If you have published your code, you need to enter the URL.

After that, you take Oauth clientId and Public API Access apiKey.

Ready, in possession of these codes you will get.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.