简体   繁体   English

如何访问Google Analytics(分析)API

[英]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. 我正在构建一个小型Google App Engine应用程序,目的是从一些来源收集统计信息,包括通过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. 尽管我对如何访问其API感到困惑,但我似乎对Google的新开发人员控制台的总体结构及其新的安全规则毫无意义。

Quick overview: 快速概述:

  • My application is java based and hosted in GAE and would like to access simple Analytics data. 我的应用程序基于Java,并托管在GAE中,并且希望访问简单的Google Analytics(分析)数据。 I'm not sure if the fact that it's a GAE application is relevant 我不确定这是GAE申请的事实是否相关
  • The monitored site is NOT hosted in GAE and uses analytics.js. 受监视的站点不是托管在GAE中,而是使用analytics.js。
  • My own google account has access to the statistics on https://www.google.com/analytics . 我自己的Google帐户可以访问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. 我发现有关访问Analytics API的所有文档(例如https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-java )都将我指向https://console.developers.google.com。并在那里进行设置。 The problem is, only my own application exists in console.developers.google.com - not the monitored application. 问题是,console.developers.google.com中仅存在我自己的应用程序,而不是受监视的应用程序。 Is the docs valid only for GAE applications? 该文档仅对GAE应用程序有效吗? 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? 我在寻找什么方法来创建供应用程序使用的API密钥-如何完成? Any step in the right direction is appreciated. 朝正确方向迈出的任何一步都值得赞赏。

From DaImTo 's comments (and the ones you posted after), seems like what you needed was : DaImTo的评论(以及您之后发表的评论)看来,您需要的是:

"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." “您自己的数据与服务帐户daimto.com/google-developer-console-service-account一起使用,当其创建时使用服务帐户电子邮件地址将其作为用户添加到Google Analytics(分析)网站的ACCOUNT级别的管理部分中然后它将可以访问。您可以将其与核心报告API结合使用。”

and this link 这个链接

(just posting this as an answer in case the comments get trashed) (只是将其作为答案发布,以防评论被破坏)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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