谷歌Analytics(分析)API V3授权允许访问我的数据 [英] Google Analytics API v3 authorization to allow access to my data

查看:365
本文介绍了谷歌Analytics(分析)API V3授权允许访问我的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,允许用户自己的谷歌Analytics数据使用谷歌API v3中看到的。
一切我研究似乎表明,用户需要登录到自己的谷歌帐户并授予我的应用程序访问之前,我可以开始查询API;然而,这不是我想要的,我只需要我的用户看到了自己的分析数据。如何授权访问我的数据的API。
我有客户端ID和客户端密钥,但是这是由谷歌的API第3版实现了OAuth是要求授权令牌,只能通过让用户登录到自己的谷歌账户来获得(是吗?)
有没有办法,只是登录到自己的谷歌Analytics帐户,并显示该信息的用户?


解决方案

我相信你想要做的是建立一个服务帐户什么:
<一href=\"https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtAuthorization\">https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtAuthorization


  

可用于自动/离线/定期访问谷歌Analytics(分析)数据为自己的帐户,例如,建立你自己的谷歌分析数据的实时仪表板,并与其他用户共享。


  
  

有您需要按照配置服务帐户与谷歌Analytics(分析)合作几步:


  
  

      
  1. 注册API控制台中的一个项目。

  2.   
  3. 在谷歌的API控制台的API访问窗格下,创建一个
      设置为服务帐户的应用程序类型的客户端ID。

  4.   
  5. 登录到谷歌Analytics(分析)并导航到管理部分。

  6.   
  7. 选择您想要的应用程序能够访问该帐户
      至。

  8.   
  9. 添加电子邮件地址,从API创建的客户ID
      步骤#2控制台,如选择谷歌分析的用户
      帐户。

  10.   
  11. 按照服务帐户说明访问谷歌Analytics(分析)数据:<一href=\"https://developers.google.com/accounts/docs/OAuth2ServiceAccount\">https://developers.google.com/accounts/docs/OAuth2ServiceAccount\"

  12.   

I am developing an app that allows users to see my own Google Analytics Data using Google API v3. Everything I researched seems to indicate that users need to login into their Google accounts and grant my app the access before I can start querying the API; however, that's not what I want, I just need my users to see my own Analytics data. How can authorize the API to access my data. I have the client ID and Client Secret, but the OAuth that's implemented by Google's API v3 is asking for an authorization token, which can only be obtained by getting the user to login into their google account (is that right?) Is there a way to just login into my own Google Analytics account and display that information to the users?

解决方案

I believe what you want to do is set up a Service Account: https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtAuthorization

"Useful for automated/offline/scheduled access to Google Analytics data for your own account. For example, to build a live dashboard of your own Google Analytics data and share it with other users.

There are a few steps you need to follow to configure service accounts to work with Google Analytics:

  1. Register a project in the APIs Console.
  2. In the Google APIs Console, under the API Access pane, create a client ID with the Application Type set to Service Account.
  3. Sign-in to Google Analytics and navigate to the Admin section.
  4. Select the account for which you want the application to have access to.
  5. Add the email address, from the Client ID created in the APIs Console from step #2, as a user of the selected Google Analytics account.
  6. Follow the instructions for Service Accounts to access Google Analytics data: https://developers.google.com/accounts/docs/OAuth2ServiceAccount"

这篇关于谷歌Analytics(分析)API V3授权允许访问我的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆