简体   繁体   中英

How to access Google Analytics API

I'm building a small Google App Engine application with the purpose of collecting statistics from a few sources, including page hits on our public web page via google analytics. I'm stumped though over how to access their API, I can't seem to make sense of googles new developers console regarding general structure and their new security rules.

Quick overview:

  • My application is java based and hosted in GAE and would like to access simple Analytics data. I'm not sure if the fact that it's a GAE application is relevant
  • The monitored site is NOT hosted in GAE and uses analytics.js.
  • My own google account has access to the statistics on https://www.google.com/analytics .

All documentation I find regarding accessing Analytics API (eg https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-java ) points me to https://console.developers.google.com and setup things there. The problem is, only my own application exists in console.developers.google.com - not the monitored application. Is the docs valid only for GAE applications? Or can externally hosted applications be added to the console somehow? Is the console relevant for the client side of analytics?

What I'm looking for is any way to create API keys for my application to use - how is this done? Any step in the right direction is appreciated.

From DaImTo 's comments (and the ones you posted after), seems like what you needed was :

"Its your own data go with a service account daimto.com/google-developer-console-service-account when its created take the service account email address add it as a user in the admin section of the Google analytics website at the ACCOUNT level it will then have access. You can use it with the core reporting api."

and this link

(just posting this as an answer in case the comments get trashed)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM