简体   繁体   English

Google Analytics API库

[英]Google Analytics API Library

I am looking to see how we can allow a user to connect with their Google Analytic's User ID and connect with our app and we can get the information from their account. 我希望了解如何允许用户与其Google Analytic的用户ID关联并与我们的应用程序关联,并且我们可以从他们的帐户中获取信息。

I am looking forward to some articles or any library thats build around the same. 我期待着一些文章或任何围绕相同内容构建的库。

I will be using PHP and MySQL. 我将使用PHP和MySQL。 Do you suggest any other Database than MySQL ? 您是否建议使用MySQL以外的其他数据库?

You can start with a database to keep things simple and since you are not looking to store too much of historical data. 您可以从数据库开始,以使事情变得简单,并且因为您不想存储太多的历史数据。 The link below should get you started with all the required libraries and documentation. 下面的链接应该使您开始使用所有必需的库和文档。

https://developers.google.com/analytics/devguides/reporting/core/v2/gdataAuthentication https://developers.google.com/analytics/devguides/reporting/core/v2/gdataAuthentication

Go for the web client based authentication model rather than the service account model. 选择基于Web客户端的身份验证模型,而不是服务帐户模型。

This will cause the api to redirect your user to google authorization page and your app will be given privileges to user account. 这将导致api将您的用户重定向到google授权页面,并且您的应用将获得用户帐户的特权。

Make sure you save the refresh token when it redirects back to you app. 当刷新令牌重定向回到您的应用程序时,请确保保存刷新令牌。 Please note that the refresh token only get sent for the very first time you app asks for permission and not after that. 请注意,刷新令牌只会在您的应用第一次请求权限时发送,而不会在此之后发送。

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

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