是否有可能将谷歌分析仪表盘整合到我们自己的网站? [英] Is it possible to integrate google analytics dashboard to our own website?

查看:123
本文介绍了是否有可能将谷歌分析仪表盘整合到我们自己的网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将Google分析仪表板显示给我的用户。无法向所有用户授予Google Analytics分析仪表板访问权限。所以我想把它整合到我自己的网站上。是否有可能将谷歌分析仪表板集成到特定的网站?

解决方案

这个问题会被问到很多。了解API的安全模型非常重要。所有Google API都使用 OAuth2.0 对用户进行身份验证。这样做的目的是使用API​​代表用户轻松访问用户数据。相比之下,您需要努力向您的用户展示您的数据



有了这个说明,您正在寻找的一个例子是Google Analytics提供的服务器端身份验证示例 API小组。

最简单的答案是在服务器端查询API,其中服务帐户,并在向用户提供任何其他数据时提供该数据。 详细阅读场景,并选择最适合您的最终目标的场景。了解API如何查看以下实体。




  • 用户使用应用程序。

  • 开发人员开发应用程序。 项目ID 及其关联的凭证
  • 用户授权应用程序通过API访问其数据。



你打破了这个范例,因为你是API角度的用户和开发者。您希望将数据与无权查看的用户共享,因此您需要使用服务帐户访问该数据并直接与用户分享。

另外,请记得将服务帐户添加到分析视图,您希望它访问。


I want to show google analytics dashboard to my users. It is not possible to give access of "google analytics dashboard" to all users. So I want to integrate it on my own website. Will it be possible to integrate google analytics dashboard on a particular website?

解决方案

This question gets asked quite a bit. It is important to understand the security model for the API. All Google APIs use OAuth2.0 to authenticate the user. This is designed to make it easy to use the API to access the Users's data on behalf of the user. In contrast you will need to do work to show Your data to your users.

With that said, an example of what you are looking for is the Server side Auth example provided by the Analytics API team.

The simplest answer is to query the API on the server side, with a service account and serve that data as you serve any other data to your users. Read the scenarios in detail, and pick one that best suits your end goals. Understand how the API views the following entities.

  • A User uses an application.
  • A Developer develops Application.
  • An Application has a project id and its associated credentials.
  • A user authorizes an application to access their data via the API.

You are breaking this paradigm because you are the user and developer from the API's perspective. You want to share your data with people who are not authorized to view it, so you will need to use a service account to access that data and share it directly with your users.

Also remember to add the service account to Analytics View you wish it to access.

这篇关于是否有可能将谷歌分析仪表盘整合到我们自己的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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