2015-11-23 13:17
浏览 47

Google Analytics - 第三方访问帐户授权

I am writing a script in which it queries Google Analytics and with the information it pulls back it creates a report.

I have went through the PHP Quickstart guide on Google Analytics website and got the developer service account set up and working.

However the problem I have run in to is that I can only access the accounts that have this email on and many other accounts I cannot add this to as I don't have permission. We cannot get the developer service account on to these accounts but we do have a company email with read permissions on their accounts.

Is there any way of querying Google Analytics through the company email instead of the developer service account? Or is there some other way of querying Google Analytics to get the information I need from their accounts?

图片转代码服务由CSDN问答提供 功能建议

我正在编写一个脚本,用于查询Google Analytics,并根据它提取的信息创建报告。

我已经浏览了Google Analytics网站上的PHP快速入门指南,并设置了开发人员服务帐户并正常工作。

但是我遇到了问题 运行到的是我只能访问有此电子邮件的帐户以及我无法添加此帐户的许多其他帐户,因为我没有权限。 我们无法在这些帐户上获得开发者服务帐户,但我们确实有一封公司电子邮件,其帐户具有读取权限。

有没有办法通过公司电子邮件查询Google Analytics而不是 开发者服务帐户? 或者是否有其他方法可以查询Google Analytics以从我们的帐户中获取所需信息?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doufubu2518 2015-11-23 13:31

    Service accounts work when you have access to the account in question, or if the owner of the account is willing to grant your service account access to the account in question by adding it as a user.

    If you cant do that then you use Oauth2 and this will require that the owner or a user of the account. Basically anyone with access goes in and authenticates your application. Hello Analytics API: PHP quickstart for web applications is the official documentation for using Oauth2. Since your company email has access to their accounts you should just be able to authenticate the application using that email and then access it.

    If you are trying to automate this. You are going to need to request offline access in order to get a refresh token then save the refresh token you will then be able to access that accounts at anytime to create your reports. without needing to reauthenticate the application.

    解决 无用
    打赏 举报

相关推荐 更多相似问题